4

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 } )
Super Mario
  • 923
  • 10
  • 16
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255

0 Answers0