Questions tagged [nested-documents]

A data/object structure where documents are contained within other documents. Relates to indexing and used in search and database platforms and engines like mongodb, solr and elasticsearch

A data/object structure where documents are contained within other documents. Relates to indexing and used in search and database platforms and engines like mongodb, solr and elasticsearch

64 questions
0
votes
1 answer

mongodb $lookup has_many association from embedded document

I have a boards collection, a lists collection, and a cards collection. An array of lists is embedded in a board document. I am trying to get an output that looks like this: { _id: 1, title: "a board", lists: [ { _id: 1, …
I_A
  • 331
  • 2
  • 14
0
votes
1 answer

How to insert Embedded Document with dotted field in MongoDb

Let say I have following Java org.bson.Document Document innerDoc = new Document(); innerDoc.put("field.with.dot", "something"); Document doc = new Document("inner", innerDoc); When I insert doc into I got "The dotted field 'field.with.dot' is not…
Vanishadow
  • 15
  • 1
  • 4
0
votes
1 answer

Update a document field with multiple nested documents

I have an existing MongoDB document that contains the field files(as well as other fields). The files field is an object and now I want to update this field with several nested documents. I have been successful in inserting one nested document with…
avtpg
  • 3
  • 3
0
votes
3 answers

MongoDB/Mongoose how to return a nested subdocument by _id

MongoDB newbie here. I have a 'client' document that looks like this: { name: "myClient", products: [{ name: "myProduct1", environments: [{ name: "myEnvironment1", changeLogs: [ { "some": "fields21" }, …
FelixFortis
  • 684
  • 6
  • 16
0
votes
0 answers

Indexing and searching nested documents in Solr 8.2

I have followed the example given in https://lucene.apache.org/solr/guide/8_2/searching-nested-documents.html#child-doc-transformer. I have _nest_path_ and _root_ fields in my schema. I want to index nested documents and search over the nested…
0
votes
3 answers

update all the elements of subdocument where subdoucment is part of list

I have document with Marketting person with different city addresses in MongoDB. { "_id": "name", "cities": [ { "id": "1234abc", "city_name": "London", "country": "England", "addresses": [ { "Home":…
SNC
  • 1
  • 2
0
votes
0 answers

Nested document using ContentStreamUpdateRequest

I am tying to achieve below document nested structure in solr using ContentStreamUpdateRequest. Its represent a document and its metadata. { "id": "1235", "title": "test", "sourcemetadata": [{ "id": "455" }, { …
sreejith
  • 1
  • 3
0
votes
3 answers

Mongodb: Aggregation/Pipilines to join two schema's data based on nested documents

Here is my schema: var mongoose = require('mongoose'); var EventSchema = new mongoose.Schema({ name: {type:String}, start_date: {type:Date}, duration: {type:String}, event_id:{type: mongoose.Schema.Types.ObjectId} }); var Project =…
0
votes
1 answer

How to compare fields in an array of nested documents

I have a problem when I want to query and compare nested documents and their fields within that document. Overall I have a database with restaurants. Each of the restaurants have a document called "openingHours" that contains a document for each day…
Emil Falk
  • 3
  • 2
0
votes
0 answers

Incorrect child querying in solr

Does anyone know what's the problem when solr does not return the correct result when querying child docs? My query is: q = {!parent which="path:2.Project.Submission AND Submission_No:1234"}path:3.Project.Submission.Agency AND Agency_Cd:AGY The…
0
votes
1 answer

How to nest documents in Solr?

In solr 6.6.0, I want to use nested objects for particular key. So suppose, I have one document as follows : { "ID": "16_nl", "countryIso": "AUS", "regionId": 30, "name": "test", "placeId": 50, "eventID": 100, …
0
votes
2 answers

Transform ElasticSearch index from field explosions into nested documents via Logstash

So we have an old elasticsearch index that succumbed to field explosion. We have redesigned the structure of the index to fix this using nested documents. However, we are attempting to figure out how to migrate the old index data into the new…
cidthecoatrack
  • 1,441
  • 2
  • 18
  • 32
0
votes
1 answer

SOLR Nested Documents filtered ok, but not sorted by relevance

I have this query: +parent_field:blabla +query:{!parent which=type:parent}+child_field:xxx~1 and in FL parent_field,[child parentFilter=type:parent childFilter=child_field:xxx~1] It works fine, meaning that: It filters the parents that have…
Cosmin Cosmin
  • 1,526
  • 1
  • 16
  • 34
0
votes
0 answers

How do i save the element of array in a nested document in mongoose?

I have a schema in which i have an array Modules, in that array i want to get the element which has the same ModuleID as recieved in req.body.ModId, I get that element, and I want to set the ModuleStatement of that element and save it, but it…
Jawad
  • 313
  • 4
  • 16
0
votes
0 answers

Only first array element gets updated in nested document Mongoose

This is my schema: let userSchema = new mongoose.Schema({ id: String, displayName: String, displayImage: String, posts: [ { url: String, description: String, likes: [String], …
JohnSnow
  • 6,911
  • 8
  • 23
  • 44