标签: nosql

在Aerospike中使用btree作为主要索引有什么优势?

我正在查看Aerospike的文档。并发现对于存储主键,Aerospike使用散列,并且散列指向BTree,而bTree包含指向实际记录的指针。据我所知,Redis只使用哈希(为了解决冲突,他们维护一个哈希列表)。哈希指向实际记录。

Aerospike使用Btree有什么优势?这不是意味着通过其主键Aerospike访问记录将花费O(logn)吗?而redis只需要O(1)。

我可能是错的,但是我从文档中了解到了全部。有人可以在这个话题上发表更多意见吗?

b-tree nosql aerospike

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

如何在MarkLogic中查找XML文档大小

我试图在部分性能中计算MarkLogic中XML的doc大小.有人可以帮我解决任何内置函数或任何查询,我可以计算我的文档的准确大小?我有一个像这样的公式:

{string-length(string(data($doc))) idiv 2}
Run Code Online (Sandbox Code Playgroud)

xquery marklogic nosql xquery-3.0 marklogic-8

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

如何在Neo4j中删除节点上的标签?

在某些节点上,我放置了一个标签“ Englist”而不是“ English”。当我尝试重新标记它时,我添加了一个新标签“ English”。现在,我在节点上都有两个标签。

如何摆脱“英语列表”标签?不删除节点。

neo4j nosql cypher

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

我可以在firebase中保存和查询标签吗?

将标记保存到firebase中的记录的方法有哪些.例如,我有一个拥有收藏夹的用户,他/她可以为收藏夹添加多个标签.我希望能够通过一个或多个标签进行查询?

这是基本结构

Users{
 favourites: {
   fav_1:{
        tags:[tag1,tag2,tag3,...]
   }
   fav_2:{
        tags:[tag1,tag2,...]
   }

   .....
 }
Run Code Online (Sandbox Code Playgroud)

}

nosql firebase firebase-realtime-database

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

尽管使用了LZ4Compressor,但Cassandra压缩比为0

我在其中创建了一个用于文档存储的键空间和表.我用的代码是

CREATE KEYSPACE space WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};

USE space;

CREATE TABLE documents (
              doc_id text,
              path text,
          content text,
              metadata_id text,
              PRIMARY KEY (doc_id)
            )
            WITH compression = { 'sstable_compression' : 'LZ4Compressor' };
Run Code Online (Sandbox Code Playgroud)

然后我将一些数据推入其中并使用命令nodetool cfstats orpd.documents我想检查压缩率.

$ nodetool cfstats space.documents
Keyspace: space
        Read Count: 0
        Read Latency: NaN ms.
        Write Count: 2005
        Write Latency: 0.050547132169576056 ms.
        Pending Flushes: 0
                Table: documents
                SSTable count: 0
                Space used (live): 0
                Space used (total): 0
                Space used …
Run Code Online (Sandbox Code Playgroud)

compression data-compression cassandra nosql

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

在Cassandra上使用淡褐色铸造是否有任何好处

我想为我的Web应用程序实现会话存储.这是我的应用程序的配置文件.

  1. 与会话相关的信息不会发生很大变化,但有时会发生变化.
  2. 会话读取(session.getAttribute())比写入(session.setAttribute())更频繁.
  3. 我不想处理基于主节点的架构(比如redis).
  4. 与会话关联的数据很小,但会话数可能很大.
  5. 查找始终采用键值的形式,如哈希映射.
  6. 我对最终的一致性很满意.
  7. 我希望能够指定复制因子.即将保存给定会话数据的节点数
  8. 我只是在寻找不会因上述功能而产生许可费用的开源解决方案.
  9. 现在我想要存储多达10,000个会话,每个会话10kb数据(平均),但最终我想扩展到100,000个或更多会话!

在我的应用程序中,hazelcast已被用于其他一些功能.但我不希望那是决定因素.Cassandra似乎满足了我的所有要求,似乎很受欢迎.有什么理由我应该选择关于卡桑德拉的淡褐色?

scalability cassandra nosql hazelcast

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

如何在Firebase的Cloud Firestore中执行查询

我在这里关注如何编写查询的文档,但我没有从中获取任何数据.数据库已填充doc提供的示例

以下是我的代码

var db = firebase.firestore();

var citiesRef = db.collection("cities");
var query = citiesRef.where("state", "==", "CA");

query.get().then(function(doc) {
if (doc.exists) {
    console.log("Document data:", doc.data());
} else {
    console.log("No such document!");
}
}).catch(function(error) {
    console.log("Error getting document:", error);
});
Run Code Online (Sandbox Code Playgroud)

如果我没有对它提出任何疑问,它的工作正常.例如(也来自doc):

var docRef = db.collection("cities").doc("SF");

docRef.get().then(function(doc) {
    if (doc.exists) {
        console.log("Document data:", doc.data());
    } else {
        console.log("No such document!");
    }
}).catch(function(error) {
    console.log("Error getting document:", error);
});
Run Code Online (Sandbox Code Playgroud)

nosql firebase google-cloud-firestore

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

db.collection不是一个函数

我试图简单地在MongoDB集合中插入一个条目Nodejs.这是我的代码:

码:

const MongoClient = require('mongodb').MongoClient;

MongoClient.connect('mongodb://localhost:27017/TodoApp', (err, db) => {
  if (err) {
    return console.log('Unable to connect to MongoDB server');
  }
  console.log('Connected to MongoDB server');

  db.collection('Todos').insertOne({
    text: 'Something to do',
    completed: false
  }, (err, result) => {
    if (err) {
      return console.log('Unable to insert todo', err);
    }

    console.log(JSON.stringify(result.ops, undefined, 2));
  });

  db.close();
});
Run Code Online (Sandbox Code Playgroud)

当我运行代码时,它显示以下错误:

错误:

TypeError: db.collection is not a function
Run Code Online (Sandbox Code Playgroud)

mongodb nosql node.js

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

按时间戳月查询Firebase数据

所以我在Firebase Cloud Firestore中有这样的记录:

[  
   {  
      "category":"drinks",
      "expensetype":"card",
      "id":"5c673c4d-0a7f-9bb4-75e6-e71c47aa8d1d",
      "name":"JJ",
      "note":"YY",
      "price":57,
      "timestamp":"2017-11-30T22:44:43+05:30"
   },
   {  
      "category":"drinks",
      "expensetype":"card",
      "id":"85731878-eaed-2740-6802-e35e7758270b",
      "name":"VV",
      "note":"TTT",
      "price":40,
      "timestamp":"2017-12-30T22:41:13+05:30"
   }
]
Run Code Online (Sandbox Code Playgroud)

我想用时间戳查询数据并获取属于特定月份或日期的数据。

例如,如果我单击日历中的特定月份(例如3月),则结果中只需要该特定月份的数据。我怎样才能做到这一点?

我已使用保存日期 firebase.firestore.FieldValue.serverTimestamp()

在此先感谢您的帮助。

编辑:

这就是我形成查询的方式

var spendsRef = this.db.collection('spend', ref => ref.where("timestamp", ">", "12-12-2017"));

this.items = spendsRef.valueChanges();
Run Code Online (Sandbox Code Playgroud)

但是它仍然返回我数据库中的所有数据

答:

var todayDate = new Date("Tue Jan 02 2018 00:00:00 GMT+0530 (IST)") // Any date in string
var spendsRef = this.db.collection('spend', ref => ref.where("timestamp", ">", todayDate));
this.items = spendsRef.valueChanges();
Run Code Online (Sandbox Code Playgroud)

nosql firebase google-cloud-firestore

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

ConfigurationException:无法识别的策略选项{datacenter1}传递给SimpleStrategy以进行键空间循环

我是Cassandra的初学者.我试过这个

cqlsh> CREATE KEYSPACE cycling
   ... WITH REPLICATION = {'class' : 'SimpleStrategy', 'datacenter1' : 1 };
Run Code Online (Sandbox Code Playgroud)

但是数据中心1无法识别

ConfigurationException: Unrecognized strategy option {datacenter1} passed to SimpleStrategy for keyspace cycling
Run Code Online (Sandbox Code Playgroud)

为什么?

cassandra nosql

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