Questions tagged [mongo-collection]
110 questions
0
votes
2 answers
Update MongoDB field value only if new providerId not exists
I have the following document in MongoDB.
{
"_id" : ObjectId("5ce34ac6a2f25b2448b9b3a3"),
"userId" : ObjectId("5ce34ac6a2f25b2448b9b3a0"),
"providers" : [
"1689736266",
"1598763690",
"1528069614",
…

Vishnu
- 704
- 12
- 34
0
votes
0 answers
Can't delete all records in collection in MongoDB
EDIT DUPLICATE
I know that the way explained in the other questions works, but I'm asking something different, that is why the method I'm using is not working when it should
Following this question I've tried to delete all documents in my collection…

Usr
- 2,628
- 10
- 51
- 91
0
votes
1 answer
Phalcon mongodb cannot update
I can't update a document with Phalcon MongoCollection from Incubator 3.3
I don't get any error after save() but data are not updated.
My code is:
$category = CategoryModel::findById($id);
$category->title = 'uno';
$category->save();
I have also…

Infobuscador
- 240
- 1
- 12
0
votes
0 answers
Mongo db.stats shows that collections exist, but show collections returns empty
I have a mongodb running on server:27017.
From a different machine, I installed mongo-client and connected to mongodb running on server.
I have three dbs in mongo: admin, local, and template (these were created for me by a script).
When I do:
use…

RebeccaK375
- 871
- 3
- 17
- 28
0
votes
0 answers
Django mongo db filter query is not returning any data
When I am trying om = OttMessage.objects.filter() its returning all the documents in the ott_message collections.
But when I am trying om = OttMessage.objects.filter(prediction_status = -1) its not returning any data.
OttMessage model.py relevant…

iamabhaykmr
- 1,803
- 3
- 24
- 49
0
votes
1 answer
Retrieving of data in an object from mongo collection
I'm using meteor, and i have not typed "meteor remove autopublish" therefore i believe my client is able to retrieve the mongo collection "List" with no issues.
So i've added 1 object into the List collection, but i can't seem to retrieve the data…

NewToCoding123
- 3
- 2
0
votes
1 answer
Java Application not recognizing my collections in my MongoDB databases.
I am creating a simple web application and I am attempting to connect the application to MongoDB. Here is the class where I am establishing the connection.
public class JavaMongoDBConnection {
public static void main(String[] args) {
try {
…

CamMoore
- 5
- 5
0
votes
0 answers
Insert 3rd party api data into meteor collection
I'm having trouble trying to save some data I'm getting from the CockTaiDB API into my Meteor Collection
state = {
randomCocktail: []
};
async componentDidMount() {
try {
const res = await fetch(
…

mwlai
- 71
- 1
- 9
0
votes
0 answers
Create Index Collection on MongoDB
suppose I have a database in mongodb called "test"
inside this db "test", I have 3 collections, which is "test-subone", "test-subtwo", "test-subthree".
let's assume that those 3 collections have an attribute in common, which is "testattr". And what…

xemjas
- 115
- 4
- 16
0
votes
0 answers
how to add prefix for specific keys on collection mongodb
I have a data set like this:
{
"_id" : ObjectId("5a7abf6b3b808dbed05d4359"),
"Name" : "Nil",
"TEST" : "APPLE",
"Group" : "Nil",
"Sector" : "Nil"
},
{
"_id" : ObjectId("5a7abf6b3b808dbed05d435a"),
…

Ankit
- 951
- 1
- 9
- 29
0
votes
1 answer
MongoClient Bring back individual items in an array if they match using Java
I have a document...
doc =
{
"Loan_Num" : "Loan002",
"Info" : "Loan for processing details."
"Loan_Items" : [
{
"Invoice_Num" : "32134324",
…

Ryan
- 31
- 5
0
votes
1 answer
MongoCollection : How to get value of nested key
I have some mongo data that looks like this
{
"_id": {
"$oid": "5984cfb276c912dd03c1b052"
},
"idkey": "123",
"objects": [{
"key1": "481334",
"key2": {
"key3":"val3",
"key4": "val4"
…

AbtPst
- 7,778
- 17
- 91
- 172
0
votes
1 answer
MongoChef not showing the MongoD collections
I am new to the MongoDB and MongoChef and connecting to the MongoDB server which is not local and is setup on some remote server(for which i do not require any VPN or visual network) using the MongoChef client.
When i pass the IP in the MongoChef's…

KayV
- 12,987
- 11
- 98
- 148
0
votes
0 answers
Mongo connector is not importing all fields from MongoDB collections just id field is imported
I have created database and collections into mongoDB using pymongo and
I want to import documents from MongoDB to solr for creating search
engine from my application. I have used mongo connector for importing
document and documents are imported but…

Agrawal Ankush
- 11
- 5
0
votes
2 answers
Creating a many-to-many relationship between 2 mongodb collections by ids
I have two collections. One is called Posts and the other is called Categories. In the posts collection, are individual posts that each contain an array of id's called categories which are id's of the categories the individual post belongs to stored…

Shingai Munyuki
- 551
- 1
- 11
- 25