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

Extract Individual particular element from Nested item in MongoDB

I am new to MongoDB. I have created a collection in MongoDB and stored the following Q1UsefulStatementsList: [{ Q1UsefulStatement: "Useful Sentence" Q1ActionsList: [{ Q1Verb: "Verb in the sentence" Q1NP: "The Noun phrase" …
Uno
  • 533
  • 10
  • 24
0
votes
3 answers

How to connect to mongodb using Kerberos from a Java application server

My mongodb is set up to use Kerberos and everything is working fine when I access the database from the shell. Now I need my Java applications to also connect to the databases, authenticating using Kerberos. Apart of the few lines in…
Dave Wilkin
  • 231
  • 1
  • 3
  • 13
0
votes
2 answers

MongoDB Aggregration Framework and Java Driver making $or condtion work

I am working on a method that queries a mongoDB using the aggregator framework. I have built up the aggregate but I keep getting the following exception: Pipeline::run(): unrecognized pipeline op \"$or" If I understand correctly when you append…
GargantuanTezMaximus
  • 1,044
  • 1
  • 12
  • 19
0
votes
1 answer

How to Represent Objects with Multiple Fields in the MongoDB Java Driver

I'm creating an aggregation pipeline in Java using MongoDB and, of course, the MongoDB Java driver. I've figured out how to do what I want in the Mongo Shell, but I'm not sure how to translate this into Java, particularly the whole concept of an…
David K.
  • 679
  • 2
  • 10
  • 23
0
votes
1 answer

How to build MongoDB connector for hadoop latest version (1.2.1)

I'm trying to build the MongoDB connector for Hadoop 1.2.1 from the montogdb instruction page (https://github.com/mongodb/mongo-hadoop) but i'm getting following error. one thing to mention, hadoop 1.2.1 is not included in the list of supported…
nightograph
  • 2,179
  • 5
  • 31
  • 49
0
votes
1 answer

Does WriteConcern.SAFE cause DBCollection.remove() to throw an exception upon failure?

I am a little confused about WriteConcern, WriteResult, and getLastError when using the java mongo driver. I understand what the different WriteConcerns mean as in WriteConcern.SAFE causes the write operation to block until the driver receives…
Nathan Reese
  • 2,655
  • 6
  • 31
  • 34
0
votes
1 answer

$unwind $push Mongo

I have a Educational Intitution document which seems like this: { name: ..., addresses: [...], courses: [ {name: ... , duration: ..., tags[...]} ] } tags has an String array. I am trying find a course which has some tags inside, like: java,…
arthurfnsc
  • 915
  • 3
  • 13
  • 30
0
votes
1 answer

MongoDB match all elements in array

I have a Educational Intitution document which seems like this: { name: ..., addresses: [...], courses: [ {name: ... , duration: ..., tags[...]} ] } tags has an String array. I am trying find a course which has some…
arthurfnsc
  • 915
  • 3
  • 13
  • 30
0
votes
1 answer

Removing an elements from basicdblist

Hi i have collection which contains around 200 documents looks like e.g "_id": 0, "name": "Demarcus Audette", "scores": [ { "type": "exam", "score": 30.61740640636871 }, { "type": "quiz", "score":…
anand24
  • 11
  • 2
0
votes
1 answer

Node.js and MongoDB Use results from one query in another

I have created a node.js module that can already query MongoDB for a set of documents using a find and output those results to JSON. My question is, knowing that node.js is asynchronous, how can I use the results from this query (items) to create a…
0
votes
1 answer

Map not compiled

I have a collection of the following : { "_id" : ObjectId("51dfb7abe4b02f15ee93a7c7"), "date_created" : "2013-7-12 13:25:5", "referrer_id" : 13, "role_name" : "Physician", "status_id" : "1", "demographics" : { "date_created" :…
Phalguni Mukherjee
  • 623
  • 3
  • 11
  • 29
0
votes
3 answers

Querying sub array with $where

I have a collection with following document: { "_id" : ObjectId("51f1fd2b8188d3117c6da352"), "cust_id" : "abc1234", "ord_date" : ISODate("2012-10-03T18:30:00Z"), "status" : "A", "price" : 27, "items" : [{ "sku" : "mmm", "qty" : 5, "price" :…
Phalguni
  • 61
  • 1
  • 9
0
votes
1 answer

Mongodb combining queries

I have two collections: collection 1: tags { "tagname":"tag1", "tagid":"id1" } Collection 2: Questions { "questionid":"1". "title":"question title", "tags":tag1 } I want to know a query which can give me all the tags with no questions. In sql it…
0
votes
0 answers

$addToSet $each exception in casbah 2.6.2

After moving from casbah 2.6.1 to 2.6.2, I got the following exception for $addToSet $each update queries. val s = Set(1,2,3) $addToSet("ids") $each(s) java.lang.NoSuchMethodException: …
deepkimo
  • 3,187
  • 3
  • 23
  • 21
0
votes
2 answers

how to store multi-dimensional array in mongoDB

I asked a question here.Simply speaking, my algorithm need a four dimension array. and the size could reach 32G. so I plan to store it in MongoDB. I have implemented it in my way. As I never use MongoDB before, my implementation is too slow, so how…
ningyuwhut
  • 609
  • 12
  • 27