-
Notifications
You must be signed in to change notification settings - Fork 235
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
ObjectID string interface #598
Comments
Important: we already have a similar implementation in place for |
Yes, in the proposed approach |
@hacksparrow When you said |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Hello, When I use find on a repo, which model has a belongsTo: // Foreign key The result userId type is a object and not a string. This is annoying, since I want to use where neq.. The userId is stroed as ObjectId, if i change it to a string, I get a string value. But it should provide it as a string, even if it is a objectId? |
Follow up of loopbackio/loopback-next#3456.
All model properties defined as
{type: String, mongodb: {dataType: 'objectID'}
should be stored asObjectID
in the database but provide a string interface in the connector APIs. Meaning, string version of theObjectID
will be used in queries and results,ObjectID
will not be directly exposed to users.Any property not defined as
{type: String, mongodb: {dataType: 'objectID'}
will no be stored asObjectID
, even if the string looks like an ObjectID.Acceptance criteria
String
toObjectID
conversion in queriesObjectID
toString
conversion in resultsThe text was updated successfully, but these errors were encountered: