S
S
Stopy2015-04-20 20:15:41
MongoDB
Stopy, 2015-04-20 20:15:41

Node.js, MongoDB, why can't I make a request?

The search for comments is performed by the id of the post sent by ajax, but for some reason returns an empty array:
ce2775357544489c9dbee45f5d640183
Although it is clear that "1" is stored in the value of post_id
This is what happens when I replace it with a specific value: So what
73f3a3e71f924503b36c0e05a29b0c30
's the problem, dear sages?
PS Thanks in advance for your replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Shatokhin, 2015-04-20
@Stopy

If req.body.id came as a string, then it will not find anything, because In monga, data is stored in BSON, which is strongly typed. Do this:
PS screenshot code is a mockery of people who want to help you :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question