collection « mongodb « Java Database Q&A





1. Checking for a long value while retriving records from a mongo collection using Mongo Java API    stackoverflow.com

I am trying to retrieve from records from my mongo collection from a Java Program. I need to get the "email" field from my collection which are satisfying a timestamp value ...

2. List of all collections in mongo database in java    stackoverflow.com

how can I get a list of all the collections in the database?

  • database - mongodb;
  • language - java;
  • ide - eclipse;

3. Count of a lazy reference collection without eager loading    stackoverflow.com

I have a Form, Submission, and FileAttachment objects. Submission has file attachments like so: Submission.groovy

@Reference(lazy=true)
Map<String,FileAttachment> attachments
FileAttachment.groovy
@Entity
public class FileAttachment {

    @Id
    ObjectId _id

    ...

4. Mongo Java-driver: recreation indexes after collection dropping    stackoverflow.com

I have a necessity to remove all data from mongo collection. Droping of collection works faster than collection.remove(new BasicDBObject()). But it also removes index definitions. Therefore I want to restore index ...

5. Create a collection with users - my javacode ok?    stackoverflow.com

Im using java/mongodb. I would like to create a table (collection) with some users. Well, its working im just not sure about my coding style. Could be this good if i ...