srcagency / mongo-document

Add some mongodb helper methods to a document
0 stars 0 forks source link

Support "keys" of and index as an array #14

Open tjconcept opened 9 years ago

tjconcept commented 9 years ago

This will fit 99% cases with a simpler syntax.

Consider supporting simply an array or a string for the index.

// now
{ keys: { completed: 1 } },
{ keys: { lock: 1 } },

// as array
{ keys: [ 'completed' ] },
{ keys: [ 'lock' ] },

// as string
{ key: 'completed' },
{ key: 'lock' },

// as string only
'completed',
'lock',