insert « mongodb « Java Database Q&A

1. Get ID of last inserted document in a mongoDB w/ Java driver

Is there an easy way to get the ID (ObjectID) of the last inserted document of a mongoDB instance using the Java driver?

2. Use mongofiles utility to access data inserted with Java GridFS API

I can successfully insert and retrieve data from MongoDB's GridFS in Java. However, when I try to access that data on the command line using mongofiles, I can't find it. The ...

3. How to insert images in mongoDB using java?

I am new to mongoDB. I want to store image documents in mongoDB. I am using java. Any links or suggestions would be appreciative!! Thanks!!

4. MongoDB-Java driver: Catch exception when insert fails

I'm doing a really basic insert like this:

    DB mongoDb = _mongo.getDB(_databaseName);
    DBCollection collection = mongoDb.getCollection(_collectionName);
catch (IOException ex)

5. MongoDb Streaming Out Inserted Data in Real-time (or near real-time)

I have a number of MongoDB collections which take a number of JSON documents from various streaming sources. In other-words there a a number of processes which are continually inserting data ...

6. Inserting data in Mongo DB using java and retrieve the data from Mongo DB using javascript

I am new to Mongo DB can we insert the data in java and retrieve the data from Mongo DB using java script? Please suggest.

7. Insert Array inside an object in MongoDB

I am new at MongoDB and I want to insert to mongodb data like this but I couldn't figure out how

  image = "cab"
  tags = [

8. Concurrency - Getting the MongoDB generated ID of an object inserted via Java in a thread safe way

What is the best method to get the Mongo generated ID of a document inserted via Java. The Java process inserting the documents is multi-thread, meaning that we need some atomic ...