6

Now I know that the Unique Index is not supported in DocumentDb, but why I cannot create a normal index using createIndex()? In mongo shell:

> db.product.createIndex({itemId:1})
{ "_t" : "OKMongoResponse", "ok" : 1 }

but the collection seems unchange:

> db.product.getIndexes()
[
{
    "v" : 1,
    "key" : {
        "_id" : 1
    },
    "name" : "_id_1",
    "ns" : "admin.product"
}
]

I also find Mongodb API Compatibility slide here. It told us that we can use createIndex function in mongodb to create non-unique index. Does anybody could tell me why?

2 Answers 2

5

By default, DocumentDB with API for MongoDB automatically indexes all properties to reduce the setup complexity. We plan to release creating / updating indexes in the next couple releases.

Sign up to request clarification or add additional context in comments.

1 Comment

Is there any new info about when this feature will be supported?
1

I think indexes are not supported at the moment (27/02/2017). Hopefully, future releases will support them.

3 Comments

but how can you explain the slide?
@Mike Probably they just listed features available in MongoDB.
can you provide a url that declares this to be truth? can you supply a command that would create an index?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.