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

Storing date field from JSON to MongoDB using Java API

I am using java api for mongodb to parse the JSON string into Java object and storing it into MongoDB. My JSON string will have fields that are date like the one given below. "created":"2012-10-17 21:39:06.385987 +0000" When I try to save the parsed…
user1757885
  • 1
  • 1
  • 1
0
votes
2 answers

delete a record in mongodb

I have a collection like this. System { System_id: 100, system_type: { [ { Tenant_Id: 1, Tenant_Info: "check", Prop_Info: ... …
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
2 answers

Using MongoDB data inside Hadoop with the help of Morphia

I've been playing with the MongoInputFormat that allows having all documents in a MongoDB collection put through a MapReduce job written in Hadoop. As you can see in the provided examples (this, this and this) the type the document is in that is…
Niels Basjes
  • 10,424
  • 9
  • 50
  • 66
0
votes
1 answer

Mongodb java - how to delete particular document

{ CONTENT1:{ YDXM:[{ "name":"1", "MBNH":"1"} {"name":"2", "MBNH":"2"}] } I want to delete the {"name":"1","MBNH":"1"}. How can I achieve this?
wurina
  • 1
  • 1
0
votes
2 answers

Error initialising MongoDB repository in SpringMVC app

I'm trying to set up a basic Spring MVC app with MongoDB intergration. Using Java 7 JDK However when trying to build the project with Maven I am seeing a compilation error as follows: [ERROR]…
cowls
  • 24,013
  • 8
  • 48
  • 78
0
votes
1 answer

Mongodb fetching only particular field

I have two collections checkone {"_id":1,"name":"alex"}, {"_id":2,"name":"sandy"} checktwo {"_id":11,"password":"alex",tenant_id:{$ref:"checkone","$id":1}} {"_id":12,"password":"suman",tenant_id:{$ref:"checkone","$id":2}} when I do dbref…
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
1 answer

Mongodb updating and setting a field in embedded document

I have a collection with embedded documents. System { System_Info: "automated", system_type: { system_id:1, Tenant: [ { Tenant_Id: 1, Tenant_Info: "check", …
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
2 answers

Mongodb combining fields to form collection

I have several collections in my db. I need to create a separate collection by getting the fields from different collections something like views in relational tables. Is there any way to do it in mongodb?
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
2 answers

Adding a new secondary in MongoDB to Distribute Load

I have two shards on three machines (using mongodb 1.8.2): nodeI including: shard1(primary) and shard2(primary) nodeII including: shard1(secondary) and shard2(secondary) nodeIII including: shard1(arbiter) and shard2 (arbiter) NodeII load…
Jack
  • 5,540
  • 13
  • 65
  • 113
0
votes
1 answer

mongodb - Sub document id value

I have a collection. look { "_id" : 13.0 , "tenantref" : { "$id" : 3.0}} I need to retrieve the value of id 3.0 using java. I am getting null pointer exception. BasicDBObject field = new BasicDBObject(); BasicDBObject field = new…
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
3 answers

Mongodb Schema design suitable one suggestion

Hi I am newbie to mongodb.I am using java. I have 2 tables system, system_properties in my relational table. Something like this. Table Fields values System System_ID(PK),…
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
1 answer

Mongodb java - how to query for particular reference id value

I have two collections checkone {"_id":1,"name":"alex"}, {"_id":2,"name":"sandy"} checktwo {"_id":11,"password":"alex",tenant_id:{$ref:"checkone","$id":1}} {"_id":12,"password":"alex",tenant_id:{$ref:"checkone","$id":2}} I am…
Jessie
  • 963
  • 5
  • 16
  • 26
0
votes
1 answer

Views exists in mongodb?

Possible Duplicate: SQL view in mongodb I am newbie to mongodb (java). I need to know whether something like views(in relational) exists in mongodb? Is it possible to create views mongodb?
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
2 answers

is procedure exist in mongodb

I am newbie to mongodb (java). I need to execute list of commands(queries in relational) by using something similar to procedures in relational db. Is it possible in mongodb?
Ramya
  • 1,067
  • 6
  • 16
  • 29
0
votes
0 answers

Log4mongo for Java: Could not instantiate appender named MongoDB

Log4j.properties file log4j.rootLogger=ERROR, MongoDB log4j.appender.MongoDB=org.log4mongo.MongoDbAppender log4j.appender.MongoDB.databaseName=appName log4j.appender.MongoDB.collectionName=test When I build the application I get an error, Could not…
user679526
  • 845
  • 4
  • 16
  • 39