mongodb Query on string length in MongoDB If you need to query on string length, you will need to use the $where operator. As per the documentation, you can pass either a string with a JavaScript expression or a JavaScript function. The downside to this operation is that it operates on
mongodb Aggregate on string length in MongoDB It's not actually possible to use the aggregation pipeline to aggregate on string length, at last in MongoDB 3.2 (the current version as of this writing). You may think that you can use the $size operator, but alas you'll end up with errors
mongodb Updating embedded documents in mongodb To update an embeded document in an array when using mongo you will use the positional selector. The positional selector, when used in conjunction with update has two rules the positional $ operator acts as a placeholder for the first element that matches the query
mongodb Mongoose and Q There are some gotchas to working with Mongoose and Q. Here are a few things I've found that you need to be aware of... Binding Attempting to directly invoke a mongoose function with ncall or napply won't work because it looses its function binding.
mongodb Add a new property to a document in MongoDB This is an example of adding a new property based on another collection. In this case, I have two collections users and posts and I need to add a new property to posts that I also added to users In this example, I have