Skip to content
Advertisement

Tag: mongodb

MongoDB 4.4, Java driver 4.2.3 – InsertManyResult.getInsertedIds() not returning IDs for all inserted documents

I am trying to retrieve values of _id for inserted documents after successful InsertMany operation. To achieve this I am using InsertManyResult.getInsertedIds(). While this approach works most of the time there are cases where not all _id values are retrieved. I am not sure if I am doing something wrong but I would assume that InsertManyResult.getInsertedIds() returns _id for all

Spring Data Mongodb Query by embedded document id

i am trying to query a model that contains a @Reference as attribute like: and so on, then i have a query with more logic and code but in resume i have to filter by the field _id from Branch object, its just id on the object but on database its _id, ok no problem its normal behavior for the

Using the MongoDb Java drivers is there a way to get Filters function dynamically

ie., Filters.search(“eq”, “name”, “Smith”) does the same thing as Filters.eq(“name”, “smith”) I’m writing some code that will search MongoDb depending on parameters passed in… So currently, my ugly code looks like I’m hoping there is something like Or perhaps there are other methods in the MongoDb java driver that can help. I’ve looked through com.mongodb.client.model.Filters and com.mongodb.client.model.* but haven’t seen

Java MongoDB Authentication Verification

I am trying to find a way to create a gui login for a database application that uses MongoDB. The server is 3.6 and the Java driver is 4.1.1. I can connect to the database and perform all CRUD operations via the application. I’m getting a little confused out how to write a simple authentication gui interface. It seems if

Panache with MongoDB find distinct

I have documents with “tags” arrays as properties. Now I want to query all distinct tag-items. Solution in mongo shell: which gives me: But how can I achieve the same result with Panache? The PanacheMongoEntity does not offer a specific distinct method. Nor do i know how to use the find method to achieve my goal or if it even

Advertisement