All Questions
Tagged with mongodb-query aggregation-framework
5,556
questions
3
votes
1
answer
41
views
How can I filter an ISODate field based only the in the time in MongoDB
I have a collection with the following structure in MongoDB:
{
"Name": "Test",
"StartDatetime": ISODate('2024-05-15T15:00:41.180+00:00'),
"...
1
vote
1
answer
30
views
mongod multi nested is not working as expected
I have some doubts with $in here , I have following type of documents in my db:
{
"a": [
{
"p": [
{
"pid": {
"CC": "A"...
0
votes
0
answers
52
views
Mongo Data API find documents count
Can the total document count be extracted using Mongo Data API? If there are a million records in the Mongo DB collection I need the count.
Tried with Mongo data API /find the endpoint. But not sure ...
1
vote
1
answer
28
views
Create array of elements based on another existing array using MongoDB Aggregation
I need to take a field from a document as input, like below:
"participants": ["John", "Peter"],
and make the output field like that:
"participants": [
{
...
-5
votes
0
answers
32
views
how to find document inside array in mogodb [closed]
This is mongodb modal
new Schema(
{
mrp: {
type: Number,
required: true
},
selling_price: {
type: Number,
required: true
...
0
votes
0
answers
21
views
Mongo DB Atlas | Aggregation not getting response
Am doing a personal project and using MongoDB Atlas for storing documents. I have the below code
app.get('/admin/dashboard', (req, res) => {
console.log('Received request for admin ...
1
vote
3
answers
46
views
How to convert a positive integer to binary inside mongoDB aggregation
I was looking for a way to convert a positive integer into a binary array inside a mongoDB aggregation pipeline.
There is $bit operation which can't be used inside an aggregation pipeline.
This ...
0
votes
0
answers
31
views
Problems with my query in the json validator
[
{
$addFields: {
Larva: { $toInt: "$Larva" },
Ninfa: { $toInt: "$Ninfa" },
Pupa: { $toInt: "$Pupa" },
}
},
{
$group: {
...
0
votes
0
answers
24
views
Getting Values in 15 Min Invervalls with MongoDB Aggregatio
I do have a MongoDB collection that stores values from some Airflow sensor. For putting these values into a line chart, I need these values grouped together into 15 minute intervals. My aggregation ...
0
votes
0
answers
32
views
Want to extract specific column and fetch count based on the condition
I have below documents in Mongo DB:
{_id
666b07c615b7246
host
"SERVER1"
ip_address
"10.0.0.1"
status
"Running"
timestamp
2024-06-13-01-00-10}
{_id
666b07c615b7246
host
&...
1
vote
1
answer
62
views
MongoDB $lookup on multiple conditions: join with empty array field
I have two collections,inf and data.
inf sample:
{
"_id": {
"$oid": "662bb5218bd38ee73cd579f0"
},
"point": 12,
"code": "bc010",
...
0
votes
2
answers
43
views
Aggregator Query for complex mongoDB Structure
`I am trying to write an aggregator query for the complex DB document below, ideally i am looking for creating multiple streams from the given activities set, identifying the parent child hierarchy ...
2
votes
2
answers
49
views
MongoDB aggregation: Only keep the running total for the last item in the partition
I have a data like:
[
{ "grp": "A", "seq": 1, "score": 1, x: 0 },
{ "grp": "A", "seq": 1, "score": 2, x: 0 },
{ &...
0
votes
0
answers
18
views
Lookup fails when do the match in the pipeline in mongodb
I am trying for a query with lookup crops (with fields, cropid, cycleStartDate) and harvest (with fields harvestDetails.harvestDate, harvestDetails.pieces).
Kindly help me in the lookup when its match ...
0
votes
0
answers
65
views
Summarize each second in a timeseries with MongoDB with gap-filling
We have thousands of IoT devices sending measurements throughout the day. This is being stored in a MongoDB instance as a simple timeseries, with a value, a timestamp and an identifier.
Example data ...