These are chat archives for Automattic/mongoose

30th
Jun 2015
Stephan Kristyn
@nottinhill
Jun 30 2015 09:37
Hi all, is the use of the collection keyword possible to access underlying node's mongodb driver? peachesModel.collection.insert basketArray, (err, cb) ->
Stephan Kristyn
@nottinhill
Jun 30 2015 12:33
guess so, since it works :)
Erinç Fırtına
@EricMcRay
Jun 30 2015 14:05
Hi all! I need a suggestion for validation. I have a Schema like below. How can I validate users uniqueness? Users should comment only once.
{ 
_id: ObjectId, 
text: String, 
comments: [{ 
user: { type: ObjectId, ref: 'User' }, 
text: String
}]
}
Mark Herhold
@MarkHerhold
Jun 30 2015 22:56
@EricMcRay { type: ObjectId, index: { unique: true }}