Questions tagged [mongodb-java]

MongoDB is a scalable, high-performance, open source, document-oriented database. This tag is used for questions related to the Java language bindings and drivers for MongoDB.

Java Language Center

Java Driver

Basics

Specific Topics and How-To

Reference

1045 questions
0
votes
1 answer

Raw javascript mongodb queries using db.eval() in java

currently I'm working on a project in JAVA, and I need to run the Javascript Mongo queries through JAVA, and I figured I can do something like that using db.eval() in java. Problem is I have the following Javascript query for Mongo, and I have no…
diba6122
  • 31
  • 1
  • 7
0
votes
1 answer

querying on internals in mongo

I have document structure like: { "_id": { "$oid" : "51711cd87023380037000001" }, "dayData": "{ "daysdata":{"date":"02-12-2013","week_day":"","month":"","date_day":"","year":"2013"}}" } I want to extract document having date =…
dsr301
  • 759
  • 3
  • 7
  • 21
0
votes
1 answer

How to identify document in MongoDB in Java

I am wondering if MongoDB provide some good schema for identifying documents in the database. Suppose I have initialized a database like this: public static void main(String[] args) { MongoClient mongo = new MongoClient("localhost", 27017); DB db =…
Li'
  • 3,133
  • 10
  • 34
  • 51
0
votes
3 answers

Mongodb: Can't save a new element added into BasicDBList

I am trying to add an element to a BasicDBList array and save it back to Mongodb, but when I check the result, it is not written. What did I do wrong? I use java driver version 2.7.2. DBObject dbObject = coll.findOne(dbQuery); BasicDBList…
coolsuntraveler
  • 317
  • 5
  • 13
0
votes
1 answer

How to know the status of mongodb functions in Java

If a function call is done in java like: collection.update(match, new BasicDBObject("$pull", update)); How can I know the number of documents updated in database after this statement execution? And my other problem is, that I want to remove an…
0
votes
1 answer

Mongodb going to sleep and retry. total sleep time after = 38ms this time:100ms

I can see the following in my tomcat logs but do not understand why and how to solve: Mar 19, 2013 3:50:01 PM com.mongodb.DBPort _open SEVERE: going to sleep and retry. total sleep time after = 38ms this time:100ms I am using java,…
checklist
  • 12,340
  • 15
  • 58
  • 102
0
votes
1 answer

How to retrieve element present inside array in Mongo DB?

I have structure shown below: { field1: "somevalue", name:"xtz", nested_documents: [ { x:1, y:2, info:[ …
Sachin
  • 3,424
  • 3
  • 21
  • 42
0
votes
0 answers

Script for saving large no of entries in mongodb

I have a mongodb database server.I want to get it fill up with large number of entries in a particular collection let say a collection named "user". I want to know if there would be a script for saving large no of randomly created entries in my…
0
votes
1 answer

MongoDB: Is there a way to find documents & set a value in them in the same operation?

I have a collection called "messages". Each message has a 'read' boolean value. In some instances when I retrieve the messages, I'd like to set the value to 'true', while returning the pre-modified value. So, let's say I have 1 message, whose…
Vladimir
  • 2,481
  • 4
  • 31
  • 41
0
votes
0 answers

Persisting objects containing primitive arrays with spring-data-mongodb

I'm using spring-data-mongodb version 1.1.1.RELEASE. I am able to persist an object if all the member variables are primitive types, even if the names of the @PersistenceConstructor arguments don't match exactly the names of the member variables by…
0
votes
3 answers

MongoDB and Admin UIs

I want to search about MongoDB for Java, its own site is good. But i want to learn much and its Admin UIs,is any book you can recommend to me? or any other good blog? Thanks.
user527
  • 205
  • 2
  • 7
  • 18
0
votes
1 answer

Generating sequence number in mongoDB

I am using java,Datanucleus,mongodb and JDO in my project. I have a requirement where I should generate sequence number and store it in DB. I was going through various links and found that DataNucleus supports the automatic assignment of sequence…
Abhinav
  • 1,720
  • 4
  • 21
  • 33
0
votes
2 answers

ORM for Spring-MongoDB integration with native querying support

I am a new to using Mongo DB and exploring the frameworks around for migrating from mysql to mongodb. So far from my findings I have been able to figure out SpringMongo as the best solution to my requirements. The only problem is that instead of…
mickeymoon
  • 4,820
  • 5
  • 31
  • 56
0
votes
1 answer

How to Query MongoDB, only using the value of inner elements and it's path

I am new to MongoDB. And now i got a puzzle: say i've got a query workable in mongo console { "_id": { "$oid": "50a5e1cd703d7e9c65326bf9" }, "people":{ "name":"arthur", "tele": "001-837475" …
user1570120
  • 87
  • 1
  • 6
0
votes
2 answers

Java+MongoDB hosting

I have a mobile app for which I need a java/mongodb support in the Backend. I am thinking of various combos to use. I dont wanna spend a lot of money to begin with as its just a 'hobby' app, for now. These are the various options I have thought…
sharath
  • 3,501
  • 9
  • 47
  • 72