All Questions
Tagged with mongodb-query mongodb
16,804
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'),
"...
0
votes
0
answers
13
views
Why is parameter allowDiskUse is not working in my JasperReport using MongoDB aggregation query
I've created a Jasper Report using an aggregation pipeline from a MongoDB data source and everything was working properly with small amount of data but now that we have more and more data this query ...
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"...
-1
votes
0
answers
26
views
I want to sort my data according to nearest location
Hi i want to get data nearby location for that I am providing coordinates so its giving right data but I want all data in sorting order by coordinates like I have searched for vadodara then it should ...
0
votes
0
answers
16
views
Unable to query using Reference id in morphia 2.4.14 for Reference entity. use of Key<> is deprecated
I have an Entity Book. It contains Language entity. Language entity is stored as DBRef() in database. I need DBRef.
@Entity("Book")
class Book{
@Reference(language_id)
private Language ...
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": [
{
...
-2
votes
0
answers
20
views
In a time-series collection get price 5m, 10m, 1 hour and 24 hours ago [closed]
I have a MongoDB time series collection that stores prices information. It has following schema
{
timestamp: ISODate(),
token: String,
price: Decimal128
}
I want to fetch a list of all tokens, where ...
-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
1
answer
35
views
Mongo How to get only available documents by date
I have documents that associated to students:
[
{
'_id': 1,
'name': 'Anna',
'vacation_start: '2024-01-01',
'vacation_end': '2024-01-03'
},
{
'_id': 2,
'name': 'Bob',
'vacation_start: '2024-01-01',
'...
0
votes
1
answer
51
views
Batch update of records in MongoDB
I iterated over records in the batch step and in Batch Aggregator I wanted to update all of them at once in mongoDb. Is there a way to update them all together or I need to separately update each one ...
0
votes
1
answer
23
views
Add a field inside an array within a MongoDB object, with values computed dynamically based on other values inside the same nested array
I have a simple MongoDB array of objects with this structure:
[
{
"_id": {
"$oid": "6688c2f6b79f2bfefb751d5f"
},
"date": "06/07/2024&...
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
1
answer
35
views
MongoDB query for points with cutout
In my lootPoint collection I have the data like this:
{
"_id" : "1856132932",
"point" : {
"type" : "Point",
"coordinates&...
0
votes
0
answers
22
views
Mongodb query doesn't post or put data in deploy
I'm developing a simple forum website. It has a react frontend + node backend, with mongodb cloud as database and AWS Cognito for signup/ verification/ sign in. When a user signs up: 1. create a user ...