I’m new to Java Mongo DB. I have to Store a huge amount of data. I’m planning to store it in a collection. I have few doubt in that.
-
How to access the elements of a collection? (for example: Access first 5 elements or 10th to 15th elements)
-
Is it possible to access nth element using indexes? (I hope indexes is only for sorting the collection asc or desc order)
-
To store huge data using collection is enough?
1 Ans>An iterator over database results. Doing a find() query on a collection returns a DBCursor thus
For example, to get an array of the 10-15th elements of a cursor, use
2 Ans> An index in MongoDB in the same sort of situations where you would have wanted an index in MySQL.
3 Ans> Yes