Compound Indexes in Monger Query mq/hint #237
-
Hi! I can't figure out how to get monger.query/hint working with compound indexes in monger query. i.e., I have a compound index
in my mongo database, and I'd like to provide a hint to ensure this index is used in my db query (issued from clojure). I think kind of a fundamentalish issue is that index maps are ordered (i.e. {sourceName: 1, published-date: -1} represents a different index than {published-date: -1, sourceName: -1}), but clojure maps are not ordered so I'm not sure what I'm supposed to pass in or how to organize it to get around this. I tried messing around with it for a bit, but I'm not really sure what to do or how to get it to work. Thanks! -- Sammy p.s. I read through the docs as best I could, and couldn't find anything, but if there is documentation on this, point me to it, and that would solve my issue! :D |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@sstraust consider using discussions instead of issues for questions. Clojure does have ordered maps and anything that implements the key map/collection/seq interfaces can be used with the |
Beta Was this translation helpful? Give feedback.
@sstraust consider using discussions instead of issues for questions. Clojure does have ordered maps and anything that implements the key map/collection/seq interfaces can be used with the
hint
function. Including ordered maps.