对于具有多个键的索引(即复合索引)the sequence of fields is important.
但ECMAScript对对象的定义如下:
对象是类型对象的成员.It is an unordered collection of properties每个包含一个基本值、对象或函数.
在node.js
中使用MongoDB
(例如使用this module)时,您使用的是服务器端javascript,如下例所示.
当MongoDB需要object
(又称无序属性集合)时,如何指定序列?
collection.ensureIndex({
date : -1,
client : 1,
product : 1
});