You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following query will result in a path collision error: data = await this.dataModel.findById({ id: this.Id, filter: { fields: ['total', 'total.month'] } });
And if you update the syntax to follow the MongoDB 4.4 requirements, the query returns an empty object: data = await this.dataModel.findById({ id: Id, filter: { fields: ['total.month'] } });
Current Behavior
When using the syntax that MongoDB needs in version 4.4 the response comes with no data, and if you try to use the old syntax mongoDB will reject the query with a path collision error.
Expected Behavior
This query should return data since when it is done directly to MongoDB without using the connector it works data = await this.dataModel.findById({ id: this.Id, filter: { fields: ['total.month'] } });
data should store the object: {total.month : [4,5,6]}
Additional information
I do not know if this is intended or the connector only supports MongoDB 4.2 or lower versions.
The text was updated successfully, but these errors were encountered:
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 CODEOWNERS file at the top-level of this repository.
With MongoDB 4.4 Path Collision Restrictions were introduced (https://docs.mongodb.com/manual/release-notes/4.4-compatibility/#path-collision-restrictions), as a result some queries do not work using this connector anymore.
Steps to reproduce
We are running a nodejs app over loopback3 that is using this connector to connect to a MongoDB 4.2 atlas cluster.
Package versions:
Considering dataModel as an object with:
The following query will result in a path collision error:
data = await this.dataModel.findById({ id: this.Id, filter: { fields: ['total', 'total.month'] } });
And if you update the syntax to follow the MongoDB 4.4 requirements, the query returns an empty object:
data = await this.dataModel.findById({ id: Id, filter: { fields: ['total.month'] } });
Current Behavior
When using the syntax that MongoDB needs in version 4.4 the response comes with no data, and if you try to use the old syntax mongoDB will reject the query with a path collision error.
Expected Behavior
This query should return data since when it is done directly to MongoDB without using the connector it works
data = await this.dataModel.findById({ id: this.Id, filter: { fields: ['total.month'] } });
data should store the object:
{total.month : [4,5,6]}
Additional information
I do not know if this is intended or the connector only supports MongoDB 4.2 or lower versions.
The text was updated successfully, but these errors were encountered: