Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongo dbref expansion #525

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mcleae
Copy link

@mcleae mcleae commented Apr 24, 2015

expand and nest dbrefs instead of mapping them as just the id and type

The following (where category is a dbref)

 {
      "_id" : "51a220fdb573df1144000000",
      "_source":{
          "body":"the body",
          "category":{"ref":"category","id":"5194272cfdea65e5d6000021"}
          }
      }
  }

Becomes

 {
      "_id" : "51a220fdb573df1144000000",
      "_source":{
          "body":"the body",
          "category":{
            "_id":"5194272cfdea65e5d6000021",
            "name":"arbitrary category for a thousand"
          }
      }
  }

@benmccann
Copy link
Collaborator

I'm not particularly excited about this feature. MongoDB recommends against using DBRefs

@mcleae
Copy link
Author

mcleae commented Apr 24, 2015

the feature is already in this plugin, this just changes it to expand and nest the referenced doc. if dbrefs aren't used then this has no effect, if they are then it will at least result in a nested searchable document in elasticsearch, which is in line with mongo's recommendation of nesting the related data

@mcleae
Copy link
Author

mcleae commented Apr 27, 2015

i just noticed this #350. if the preference is to have a config for enabling/disabling fetching i can take care of that. i'll aim to leave it disabled by default so as to preserve the current functionality

@mcleae mcleae mentioned this pull request Apr 27, 2015
@mcleae
Copy link
Author

mcleae commented Apr 27, 2015

@benmccann configs for enabling/disabling are in, please let me know if you have any other concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants