Mongodb Collection Field Index中的值1表示什么?

时间:2013-03-15 04:17:50

标签: mongodb

我正在使用Mongo DB作为我们的应用程序。

为了首先优化应用程序,我们首先开始使用Indexing Mongo DB COllections。

我在网上看到如下网络示例,如何对集合进行索引

db.products.ensureIndex( { "category": 1, "item": 1 } )

请让我知道值1表示什么?那是标准吗?

1 个答案:

答案 0 :(得分:2)

它表示索引中键的顺序。 1表示升序,-1表示降序。 http://docs.mongodb.org/manual/core/indexes/

中的更多详细信息