小编Vin*_*ent的帖子

是否有Firestore安全规则的模拟器?

我正在寻找一种有效测试新规则集的方法.在我决定从实时数据库切换到Firestore之前,我想测试规则.请提供解决方案或说明是否有任何在制品.

firebase firebase-security google-cloud-firestore

14
推荐指数
1
解决办法
2340
查看次数

如何将服务器时间戳(以毫秒为单位)写入Firestore

我知道如何将服务器时间戳写入Firestore作为日期字符串:

doc_ref.set({ts: firebase.firestore.FieldValue.serverTimestamp()});

但是如何将其unix时间戳存储为数字呢?这甚至可能吗?我需要能够在Algolia中镜像我的Firestore文档的子集,我不相信我可以通过时间戳字符串对Algolia索引进行排序.

javascript firebase google-cloud-firestore

4
推荐指数
1
解决办法
2011
查看次数

如何在容器优化的操作系统中设置容器ulimit

我需要在容器上设置ulimits。例如,docker run --ulimit memlock="-1:-1" <image>。但是,我不确定在Compute Engine上部署容器优化的VM时如何执行此操作,因为它可以处理容器的启动。

我能够使用选项--privileged,-e用于环境变量,甚至是覆盖的CMD来部署VM。如何部署为容器设置了ulimits的VM?

google-compute-engine docker google-container-os

4
推荐指数
1
解决办法
1071
查看次数

elasticsearch 嵌套范围查询

假设我想要一个文档的结构:

{
  "hours": {
    "open": [
      {
        "start": 10,
        "end": 19
      },
      {
        "start": 21,
        "end": 29
      }
      ...
    ],
    "closed": [
      {
        "start": 100,
        "end": 199
      },
      {
        "start": 201,
        "end": 299
      }
      ...
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

其索引具有此映射:

{
  "mappings": {
    "_doc": {
      "properties": {
        "hours": {
          "properties": {
            "open": {
              "type": "nested",
              "properties": {
                "start": { "type": "integer" },
                "end": { "type": "integer" }
              }
            },
            "closed": {
              "type": "nested",
              "properties": {
                "start": { "type": "integer" },
                "end": …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

1
推荐指数
1
解决办法
3179
查看次数