Skip to content

Tag: mongodb

Java Date to MongoDB date with Gson

Introduction I am currently working on a project that regularly saves several java objects to a MongoDB database. This object contains a Date. Problem The conversion of java Date to Json Mongo give this: But this format does not conform with MongoDB Date. MongoDB is considered as a string instead of a Date. A…

How to query mongodb with query Builder in java?

I need to make a query in java to MongoDB, how could I do it with QueryBuilder, this is my query: By the way, if anyone knows where I can find documentation to make these queries, I would appreciate it. Answer You should Refer this documentation Create a MongoCollection object. Create a list to have aggregate…

MongoDB – Update parts of object

I have the collection that stores documents per some execution Flow. Every Process includes “processes” and each process includes steps. So I end up with a ‘flows’ collection that has documents that look like this: A couple of notes here: Each flow contains many processes Each process …