javascript - MongoDB query issue - error after second query -
right, have weird problem, more related how mongodb works rather coding issue.
i'm making website in javascript (mostly) heavy on jquery, using mongodb database , nodejs server. have users have walls, , lots of information updates asynchronically. because of this, have make dives database quite often, update things - example if user leaves message on somebody's wall, or adding friend.
the problem is, once make query - trying make 1 afterwards fail. literally identical (i tested this, copy&paste, bit different first). doesn't matter if use find or update, result null second query. closing database after each dive, , returning measure.
i can't find issues anywhere multiple queries same place fails after 1 succeeds. it's if there lock somewhere, because i'm 100% sure query correct, , shouldn't return null. not hard coding works. first query works perfectly. same data, same collection.
so, question is: mongodb have query cache blocking query, or there else i've missed in how queries work? have tips , hints when having multiple database queries?
i typeerror: cannot read property '_id' of undefined result of query returning null.
i hope enough information have clue what's wrong. i'm not providing code think more matter of me not getting how mongodb works rather coding issue.
problem solved. have no idea caused it, rewrote large chunks , did trick. time!
Comments
Post a Comment