Questions tagged [mongodb-java-3.3.0]

The tag is useful for mongodb java driver version 3.3.0 for newly added features. This would be used most of the time along with the mongodb-java tag.

New features of the 3.3 java driver included:

  • Cluster Monitoring in the synchronous and asynchronous drivers
  • Command Monitoring in the asynchronous driver (support in the synchronous driver was added in a previous release)
  • Additional query parameters in the connection string
  • GridFS in the asynchronous driver
  • Additional configuration options for GSSAPI authentication.
  • JNDI ObjectFactory implementation
23 questions
0
votes
0 answers

Bucket aggregation and grouping in MongoDB Java driver

I do a short query to get some data from MongoDB using MongoDB Java Driver v 3.2. I am using Bucket and Unwind aggregation to make my work and result a bit meaningful. I made a filter based on a specific id field (IdManfc) and a specific signal…
0
votes
1 answer

Setdifference giving incorrect results

We are trying to print the difference of 2 arrays,retrieved from different collections as below.However,the setdifference does not seem to work . What may be wrong? Expected output: { "request" : [{ "requestId" : "REQ4" }], "unsent" : ["1234"]…
IUnknown
  • 9,301
  • 15
  • 50
  • 76
0
votes
1 answer

How to use $month as part of logical operators in MongoDB in Java?

I have a document {_id: abc, orderdate:(ISO date), quantity:10} and I am trying to come up with query in Java where we search for all documents with orders in a given month whose quantity is > 5 Eg: select * from documents where …
0
votes
1 answer

Deserializing Dates from mongodb with custom CodecProvider in Java gives null results

I have implemented a custom MongoDB CodecProvider to map to my java objects, using this Github gist. However, i cannot deserialize Date values, rather null values are returned. Here is the snippet of my custom encoder implementation for my pojo -…
SyCode
  • 1,077
  • 4
  • 22
  • 33
0
votes
1 answer

How to update the existing fields, embedded mongodb documents in an array in Java

I have document structure { "Name" : "MongoDB", "Client" : "Database", "Details" : [ { "Date" : "2018-07-18", "Code" : { "new" : "5", "new 1" : "3", "new 2"…
plnr
  • 1
0
votes
1 answer

Creating a MongoDB View using the Java driver

How do I create a view in mongo db which can expose all the documents from a collection? I have used following code: java.util.List tstL = new ArrayList<>(); db.createView("tst_view","collection_name",tstL); I am trying it with empty list…
passionate
  • 503
  • 2
  • 7
  • 25
0
votes
2 answers

how to get all the documents having minimum values of a particular field using aggregation in Mongodb with corresponding java code

Suppose each of my document is in the below format {"_id" : ObjectId(""),"WordName":"foo","numberOfOccurances" :1} {"_id" : ObjectId(""),"WordName":"bar","numberOfOccurances" :5} {"_id" : ObjectId(""),"WordName":"abc","numberOfOccurances" :1} {"_id"…
0
votes
1 answer

how to use compound index in mongodb using java/scala

I want to create an index on both fields a and b but I want the b field to be unique only I am not sure how can I achieve this in using compound index please help here is the code var index=collectionMongo("test").createIndex(new BasicDBObject("a",…
swaheed
  • 3,671
  • 10
  • 42
  • 103
1
2