Skip to content

Instantly share code, notes, and snippets.

@killercup
Created February 24, 2014 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killercup/9191206 to your computer and use it in GitHub Desktop.
Save killercup/9191206 to your computer and use it in GitHub Desktop.
Replacing brackets with CoffeeScript
Post
.findOne _id: id, 'public': true, 'accepted': true
.populate path: '_team', select: 'name'
.populate path: '_user', select: 'name'
.populate path: 'comments._user', select: 'name _team'
.populate path: 'likes._user', select: 'name _team'
.exec()
Post
.findOne({_id: id, 'public': true, 'accepted': true})
.populate({path: '_team', select: 'name'})
.populate({path: '_user', select: 'name'})
.populate({path: 'comments._user', select: 'name _team'})
.populate({path: 'likes._user', select: 'name _team'})
.exec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment