Reputation: 44648
I see that we can add an index by simply specifying the name of the field:
library(mongolite)
m <- mongo()
m$index("field")
How do we specify a unique index? ie:
db.members.createIndex( { "field": 1 }, { unique: true } )
Upvotes: 4
Views: 268