I'm working with Mongo and Esper in Java. Once I launched the esper server, I start adding documents and in one of my listeners I have to update some of those documents (one per time). The problem is that Mongo only updates those documents if they were in the database BEFORE I started the server, but not if I have just inserted them.
I'm running this code:
BasicDBObject searchQuery = new BasicDBObject();
searchQuery.append("symbol", newEvents[0].get("symbol"));
searchQuery.append("fecha", newEvents[0].get("fecha"));
BasicDBObject newDocument = new BasicDBObject();
newDocument.append("$set", new BasicDBObject().append("SMA10", ((Double) newEvents[0].get("valor")).toString()));
col.update(searchQuery, newDocument);
Does anyone have a clue what can be happening? If there is any other information you need, please just let me know.
Thank you very much.