如何查询orchestrate.io

我正在寻找一个简单而简单的数据库,用于一些在javascript中开发的游戏。 我在github的学生开发包中看到了Orchestrate.io 。 我find了一个合适的drivermodule nodejs编排并集成了它们。

问题来自我的数据查询编排。 我已经保存了分数并用db.list('collection')查询它们,但是这似乎没有响应所有的数据。 它让我感到有些价值不被返还。

我读了db.search('collection','query')函数。 但是我并不真正了解如何返回所有数据,因为我不想以特定的方式进行查询。 我的对象很简单,如下所示:

 {"name":"Jack","score":1337} 

据我所知,当把这些值放到一个pipe弦乐集合中时,必须发送一个关键字。 但是我想查询整个集合,并根据分数获取后裔的值。

至于现在我最终在客户端sorting的结果。 我希望你们可以给我一些提示,可以查询特定的值!

您可以select使用SearchBuilder

db.newSearchBuilder() //Build a search object .collection('collection') //Set the collection to be searched .sort(score, 'desc') //Set the order of the results .query("*") //Empty search .then(function (res) { //Callback function for results //Do something with the results })

资源

默认情况下,.list使用10的分页限制。您可以增加它,例如:

 db.list('collection', { limit: 100 }) 

或使用.links,.links.next(从文档):

 db.list('collection', { limit: 10 }) .then(function (page1) { // Got First Page if (page1.links && page1.links.next) { page1.links.next.get().then(function (page2) { // Got Second Page }) } })