Brandon Bertelsen
Brandon Bertelsen

Reputation: 44648

Unique index with mongolite

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

Answers (0)

Related Questions