Questions tagged [embedded-documents]

95 questions
1
vote
2 answers

Update double nested emedded documents in mongodb nodejs without using number index

I want to update Itinirary which is embedded subdocument inside the packages which itself is a embedded document.I tried using index and was successful like this : "$set":{'packages.$.itinerary.0.to': "kausaltar"} but I don't want to use index…
1
vote
1 answer

How to download a text file containing data for an interactive barchart but has no URL, just an XPath? Is Selenium a potent solution?

I have scripted a Python code that lets me click on the submit button to make input selections and get their output on a given website. However on the screen, there's an interactive bar chart i.e. if I move my mouse over it and click on the bars, I…
1
vote
1 answer

Update nth array value under embedded documents in MongoDB

I want to update only the nth position in that array, Instead of updating all the values in the array. db.patient.insertMany([ {firstName: "Thanga",lastName:"Durai", age:27,history:{disease:["Cold","ulergy"]}}]); Here, Can you please tell me how to…
Vivek Harry
  • 419
  • 3
  • 11
  • 25
1
vote
1 answer

how to rename embedded document's key field name

{ "_id" : ObjectId("5b8b8ea4b918dd57eb65a314"), "roll_no" : "029", "address" : { "city" : "abc", "street" : "xyz" } } I want to rename address->add I tried these:…
1
vote
0 answers

How to apply aggregation on the first field of first object of a array of objects in mongodb

I have data in the format given below. { "_id" : 19, "name" : "Gisela Levin", "scores" : [ { "score" : 44.51211101958831, "type" : "exam" }, { "score" : 0.6578497966368002, …
Negi007
  • 51
  • 1
  • 5
1
vote
0 answers

Flask admin: add dynamic choices to SelectField inside embedded document

I have a string field inside an embedded document and override this field to be a selected field. After overriding, I add an empty list of choices as an argument to the selcted field. The issue is that on form access we try to add some dynamic…
loler
  • 11
  • 2
1
vote
0 answers

Mongoid query embedded document with parent ids

I have a two models, Deal and Contact. My Contact model is embedded inside the Deal model, and it can be many contacts inside one Deal. How can I get Contacts with deal_ids ? EX: deal_ids = ["a9s82sj", "kswid"] I want to get all Contacts that are…
1
vote
2 answers

Mongoid, no persistence on embedded documents

I'm very annoyed with mogoid and embedded documents. I can't find the proper way to create, edit, or destroy them. I've tried all methods i've found around the web, but none of them seems to work. I've also tried many tests on the rails console,…
1
vote
0 answers

Distinct list of values from embedded document in mongodb

I'm going crazy... I come from the sql world an this is my first real experience with mongodb. I have a given json/object structure (I know, this is not perfect but it has to be so because of existing data and other applications), stored in a…
1
vote
1 answer

How to update an Embedded Document List Field for single document with Mongoclient?

Let's say we have the following. class Post(Document): uid = StringField(required=True, unique=True) text = StringField(required=True comments = EmbeddedDocumentListField(Comment) class Comment(EmbeddedDocument): comment_id =…
1
vote
1 answer

Link to specific sheet in embedded Google Sheets

Due to the great number of sheets I will have in my Google Sheets I want to create links to all sheets on the first sheet. This works within Google Sheets with the following code: function goToSheet2() { goToSheet("Sheet2"); } function…
1
vote
1 answer

Conditional embedded document for mongodb objects

I need help with thinking about data modeling (I am using python and mongoengine). I have an object that I would like to apply different classes of embedded documents to depending on another attribute the object has. class…
Iluvatar14
  • 699
  • 1
  • 5
  • 18
1
vote
1 answer

How would one iterate over embedded documents in Meteor?

I'm in the midst of learning meteorJS, so kindly forgive my ignorance at the moment. I have a tasks collection at the back end MongoDB which contains something like this: { "name": Something", "Address": { "Building": A, …
blueren
  • 2,730
  • 4
  • 30
  • 47
1
vote
1 answer

INSERT embedded types inside embedded types on OrientDB

I'm new on orientdb and I would like to know if is possible to insert a document with three levels of depth, using a embedded inside another embedded, like the example under. I've being searching for some examples like my data with no…
Raphael
  • 99
  • 10
1
vote
2 answers

How to query a single embedded document in an array in MongoDB?

I am trying to query a single embedded document in an array in MongoDB. I don't know what I am doing wrong. Programmatically, I will query this document and insert new embedded documents into the currently empty trips arrays. { "_id" :…
melis
  • 1,145
  • 2
  • 13
  • 30