i'm working mongodb in visual studio, using c# 2.0.0 driver. (i new mongodb 3.* , new visual studio / c#, experienced in python, java, , mongodb 2.6)
i'm working on research related topic, , therefore need able specify index operation should use , explained result. (i want explain bsondocument, not matching docs.)
i know how either 1 of them, ex explain: (here projecting bsondocument since collection isn't of type bsondocument)
var options = new findoptions { modifiers = new bsondocument("$explain", true) }; bsondocument explain = await coll.find(filter, options).project(new bsondocument()).firstordefaultasync(); or use specified index:
var options = new findoptions { modifiers = new bsondocument("$hint", "indexname") }; var cursor = await coll.find(filter, options).tolistasync(); but don't understand how add index hint modifier parameter well?
is possible both?
Comments
Post a Comment