开发者

Does MongoDb C# Samus have Indexing feature?

I was trying out MongoDb c# driver by Samus. Is there any way to index the documents using this driver? D开发者_开发技巧oes it provide that feature? If it does please let me know how to. I could not find proper documentation for this.

Regards, Lalith


You can use MongoDB.CollectionMetadata to create indexed in mongo db

Below the sample

            CollectionMetadata cmd = DB["indextests"].MetaData;
            cmd.CreateIndex("lastnames", new Document().Add("lname", IndexOrder.Ascending), false);
            Dictionary<string, Document> indexes = cmd.Indexes;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜