Questions tagged [mongoose-q]
5 questions
4
votes
1 answer
difference between Query and Model mongoose
these days i'm trying to learn more about mongoose to implement it in my project ,while going through the doc , i saw both Model and Query, both have many methods in common ,my question is what is the difference between them for…

Alexander Pato
- 41
- 2
3
votes
1 answer
Mongoose post-remove event doesn't fire
I have this code in my model:
ContentSchema.post( 'remove', function( item ) {
index.deleteObject( item._id )
})
Here's what's in my controller:
Content.find( { user: user, _id: contentId } )
.remove( function ( err, count ) {
if ( err ||…

Noah
- 4,601
- 9
- 39
- 52
1
vote
0 answers
Mongoose-q keeps returning null
Node noob and first time asking a question here so I hope I'm doing this right..
I used https://github.com/jkvoorhis/userAuth as a base for the formatting of my code, replacing Orchestra with Mongoose methods.
Whenever I send a POST request to…

midorimidori
- 11
- 2
1
vote
1 answer
Looking for a more efficient way of doing many queries in mongoose-q
I'm using mongoose-q (a promise wrapper for the popular mongoose mongodb ORM for node.js).
However, I fell like maybe these nested promises are not much better than callbacks.
Is there a better way to do these queries?
User.findById(toFollowId)
…

chovy
- 72,281
- 52
- 227
- 295
0
votes
1 answer
MongoDB Find Query, dynamically change search keys based on key-value in a document
Country data looks like -
[{
inEU : true,
x : {...},
y : {...}
}
{
inEU : false,
x : {...},
y : {...}
}]
I need to choose either x or y object based on inEU field is set to true or false. X and Y object have the same…

Manthan
- 193
- 1
- 1
- 14