meteor-server-session icon indicating copy to clipboard operation
meteor-server-session copied to clipboard

Mongo index

Open lorensr opened this issue 10 years ago • 3 comments

Collection.findOne({ 'key' : key });

Might be good to do an ensureIndex call for key.

lorensr avatar Jan 28 '15 10:01 lorensr

I actually tried to do that, specific to text indexes but when I last tried it was a feature not supported with the current MongoDB version.

matteodem avatar Jan 28 '15 11:01 matteodem

From what I understand, Mongo "text" indexes are for searching:

http://docs.mongodb.org/manual/core/index-text/

findOne({ 'key' : key }) is a regular query, not a search query, so it would benefit from a regular index?

lorensr avatar Jan 28 '15 22:01 lorensr

Oh sorry, I just confused two repositories. I think that's a good idea. I'll let this open and add the call ensureIndex for the key field soon-ish.

matteodem avatar Jan 29 '15 16:01 matteodem