Questions tagged [mongo-collection]
110 questions
1
vote
3 answers
Multiple push with reduce() in PHP MongoCollection->group()
I need to understand a MongoCollection->group() feature. PHP manual for group() states what follows:
insert(array("category" => "fruit", "name" => "apple"));
$collection->insert(array("category" => "fruit", "name" =>…

godzillante
- 1,174
- 1
- 17
- 32
1
vote
2 answers
Migrate SQL Server DB to MongoDB
I want to Migrate all the features and functions of SQL Server DB to Mongo DB, But I am stuck with Foreign Key Concept, I know there is no Concept ForeignKey in NoSQL Dbs, But I want to connect and Store the Tables as Shown Below, Please share your…

Akshay Joy
- 1,765
- 1
- 14
- 23
0
votes
1 answer
Find & FindAll methods missing in MongoDB.Driver v1.3.1 for C#
I am beginning to use MongoDB with C# and through following a few tutorials I have found that the methods Find & FindAll no longer exist in the latest versions.
Could somebody explain why and also, how would I now get the same functionality using…

Adam Nuttall
- 477
- 2
- 16
0
votes
1 answer
How to configure the multi tenant mongodb collection using Micronaut?
Im having a requirement to create mongodb collections by tenant specific.
Eg: I have a collection called audit_logs, but I want to create the following way
tenant : EAD collection : ead_audit_logs
tenant : gtc collection : gtc_audit_logs and so…
0
votes
1 answer
MongoDB Query to get deeply nested field from a collection
I have a table that looks as given below:
[
{
_id: "689000",
category_id: "CC100",
versions: [
{
version_id: 001,
sub_versions: [
{
…

bazinga
- 87
- 2
- 9
0
votes
1 answer
Time Series Data in Mongodb did not do document optimization
Suppose we insert 10 objects to mongodb time series collection. some of those objects contains common metaField of time series collection. I had expectations that number of documents created will be less than the number of objects inserted. But this…
0
votes
1 answer
Mongodb $lookup when localField is Array of string and foreignField is in ObjectId formats
I want to do a $lookup where the localField is a String of Array which representation of an ObjectId as string and the foreign field is an actual ObjectId.
This is order collection json
[{
"_id": {
"$oid": "63fc524dda1a2789fe69bf23"
},
…

mkens
- 65
- 8
0
votes
1 answer
Trying to populate Java Pojo class with MongoDB collection and getting null
I am trying to populate the Java POJO class with the Mongo DB collection but getting null when trying to get data from the Pojo class
Here CSVRow is the POJO class name
The class constructor
MongoDatabase database;
MongoDbUtils() {
String uri =…

Harjinder Banga
- 13
- 5
0
votes
0 answers
Add New Column In Each Object Inside An Array in MongoDB
Please refer to the attached image.
Questions -
I have to add one column(column name will be Temp) with value "Hello" inside each object (0,1,2) inside "Products" Array.
No of object will not be 3 for each record.
Please help me out with this.

Akash Raj
- 39
- 1
- 1
- 5
0
votes
1 answer
MongoDB shutdown during mongodump
I was trying to backup my database, having around 50 collections and total records will be somewhere around 80 million. While dumping the collections, I got an error stating
Failed: error writing data for collection `{collection_name} to…

Ahsan Hasan
- 57
- 2
- 11
0
votes
0 answers
Mongodb, export collection with all fields without adding manually
Is there any way in Mongodb, to export collection with all fields without adding manually?
In Compass, when I go to export collection I see an example of the fields to export, example:
But if I check each document by hand, I can see that some…

pmiranda
- 7,602
- 14
- 72
- 155
0
votes
0 answers
MongoDB Java get Schema of existing collection using aggregation
I am looking for solutions to get field name and type for all nested fields including array of documents using $project $mergeobjects, $objectToArray , $unwind.
collection.aggregate(Arrays.asList(
new Document("$limit",100),
…

newbie
- 1
- 1
0
votes
1 answer
How to retrieve data based on the date range of string date field in a nested document of a mongo collection
Requirement in High level:
I have a peculiar requirement where I want to return the specific project in which specific type of property got sold between some dates.
Detailed Requirement
I have projects collection in which we store all projects…

Kiran
- 1,177
- 4
- 18
- 35
0
votes
1 answer
What happens when mongodb deleteMany{()} is executed whitout query / empty query?
i wanted to ask what happens when collection.deleteMany{()} is executed in java without any query or empty string. Will it fail to execute (as in nothing is deleted) or will it drop the whole database?

Jonathan Andrew
- 1
- 2
0
votes
1 answer
Cannot iterate through MongoDB Collection
As a step towards familiarising myself with MongoDB, I started to create simple Java Classes to perform CRUD in MongoDB. I was able to establish connection with MongoDB. Nevertheless, when I try to iterate through the MongoDB collection, I'm getting…

CoolCK
- 416
- 5
- 16