-
Notifications
You must be signed in to change notification settings - Fork 478
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
Add support of "bson.dbref.DBRef" data type for formatting value. The… #692
base: master
Are you sure you want to change the base?
Conversation
@@ -96,6 +96,8 @@ def transform_value(self, value): | |||
return value | |||
elif isinstance(value, datetime.datetime): | |||
return value | |||
elif isinstance(value, bson.dbref.DBRef): | |||
return value.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the DBRef.database
and DBRef.collection
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are correct, this change does not cover database and collection value, but only the id value.
At least, it supports DBRef data from MongoDB, and it can be used by complex search like "join" in Solr.
In order to cover database and collection value, we need to modify function transform_element and format_document which I'm working on it.
README.rst
Outdated
----------- | ||
Add support to DBRef whose datatype is "bson.dbref.DBRef". | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this, the change-log is https://github.com/mongodb-labs/mongo-connector/blob/master/CHANGELOG.rst.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this.
… "bson.dbref.DBRef" is used by Solr DBRef.
…base and DBref.id.
I have updated it to cover all database, collection and id data. It works perfect in my local environment. |
BTW, have no idea why the CI is failed for MongoDB 2.4.14 |
Does this work fine with elasticsearch? |
… "bson.dbref.DBRef" is used by Solr DBRef.