Questions tagged [mongo-collection]

110 questions
0
votes
1 answer

Write a mongo query to count the data where similar data in array?

Sample data: there are multiple similar collection: { "_id" : NumberLong(301), "telecom" : [ { "countryCode" : { "value" : "+1" }, "extension" : [ { …
0
votes
2 answers

Why do we need an additional LIMIT stage with compound index in Mongo

I am using Mongo 4.2 (stuck with this) and have a collection say "product_data" with documents with the following schema: _id:"2lgy_itmep53vy" uIdHash:"2lgys2yxouhug5xj3ms45mluxw5hsweu" userTS:1494055844000 Case 1: With this, I have the following…
Naman
  • 27,789
  • 26
  • 218
  • 353
0
votes
1 answer

'Public member 'Find' on type 'MongoCollectionImpl(Of BsonDocument)' not found.'

I am trying to find a particular user from a mongodb collection that matches the given id. Folliwng is my VB.Net code. However, I keep getting the error 'Public member 'Find' on type 'MongoCollectionImpl(Of BsonDocument)' not found.' Public…
PineCone
  • 2,193
  • 12
  • 37
  • 78
0
votes
1 answer

error mongo without mongod running first locally in win 10

I have this mongo.zip installed in my win 10. I have set the environment path with bin. Somehow whenever I start command line, my mongo cannot start without mongod first. C:\Users\asus>mongo MongoDB shell version v4.4.1 connecting to:…
rulisastra
  • 311
  • 1
  • 2
  • 14
0
votes
2 answers

Mongodb shell drop collections with wild card

I have a bunch of collections with the same prefix e.g. data_user_1, data_user_2 etc. There are also a few collection in between that I wanted to keep and skip from dropping. So I search for a solution to a) drop all exclude specific b) drop all…
FishingIsLife
  • 1,972
  • 3
  • 28
  • 51
0
votes
1 answer

Use WriteConcern in MongoCollection.deleteMany in mongo-java-driver 3.12

I am using mongo-java-driver-3.12.X version. I want to change the deprecated API DBCollection.remove(query, WriteConcern.UNACKNOWLEDGED); to MongoCollection.deleteMany(query) Is there a way to specify WriteConcern? What will be the default…
0
votes
0 answers

How to delete all mongo documents in c# within particular time span

I'm trying to delete mongo document from particular collection in c# how i'm trying now is var document = collection.Find(_ => true).FirstOrDefault(); //get all the document foreach (var item in (dynamic)document) …
dev
  • 163
  • 1
  • 11
0
votes
2 answers

Default options for dynamic MongoDB collections

I am aware that MongoDB will dynamically create a collection when you attempt to insert a document into a non-existent collection. My question is: How do I set up default options so that the collection has the options I want when it is dynamically…
0
votes
1 answer

How can i fix this mongo c# find by Id to return result other than null?

I am trying to return a single value from a collection in my MongoDB database, however I am getting a null value returned and a document with that id exists in the collection. public async Task GetBusiness(string businessId) { …
floormind
  • 1,868
  • 5
  • 31
  • 85
0
votes
0 answers

Meteor Collection fetch working after insert only

I am fetching data from Mongo Database using Collections but it not returning any data while fetching but when i insert data it then returns fetch call . Template.message.events({ 'click #tag_message-actions__button' : function(){ …
Wahdat Jan
  • 3,988
  • 3
  • 21
  • 46
0
votes
1 answer

Is there a way to filter a MongoDB document by other values within that document?

I have a document I'm trying to filter with rows created by aggregation functions that look like: { "_id": { "ID": "randNum01" }, "ImportantVal1": 50, "importantVal2": 22 } { "_id": { "ID": "randNum02" }, …
0
votes
1 answer

How can I access a parent client-side-collection from a child template in Meteor-Blaze?

I have a child template in which I want to be able to manipulate the parent's client-side-collection. The child template is a reusable component and can not have a global collection. Unluckily Template.parentData(n) doesn't work for me somehow.…
MauriceDev
  • 31
  • 7
0
votes
1 answer

How to find from mongo collection using comma separated string in C#

I want to fetch data from mongo using comma separated string in C#. Below is my code. string numbers = "32,12,56,78"; List calling_number= new List(); IMongoCollection Collec; calling_number=…
0
votes
1 answer

Unable to find collection I want to print

Im trying to display the collection of a mongodb server but having difficulty in the MongoController class finding the collection in the FindIterable. I believe it may be a syntax error but I cannot understand what is wrong. MongoController…
0
votes
1 answer

Find not working for GridFS after updating metadata

I added a step in my application to persist files via GridFS and added a metadata field called "processed" to work as a flag for a scheduled task that retrieves the new file and sends it on for processing. Since the Java driver for GridFS doesn't…