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
I was wondering what your opinion was on relaxing the check to detect prior mongoist connections? In particular, this check will fail if the mongoist reference that is passed in is a mongoist reference where the module was loaded separately. This can happen either due to version differences, multiple linked packages during testing, or any other situation where mongoist isn't flattened to a single module under a package's node_modules. In this situation, the failure to detect the reference as a Database reference means that we'll return undefined even though we had a valid connection that we could have used to make a new connection from.
It's most likely too dangerous to reuse the connection if it was loaded via a different instance of the mongoist package as we can't be sure of API uniformity, but what do you think about using the passed in mongoist reference in order to synthesize a new mongoist reference?
The text was updated successfully, but these errors were encountered:
Hi, yes the check is a bit 💩 - I'm considering to export the mongoist package name and version of and to check against that.
Considering building a new connection/mongoist instance from a passed mongoist reference does not fit the current API without a major change, perhaps expose a function createFrom to create a new connection from a given mongoist or whatever instance.
Awesome! I'd agree it'd be nice not to require a major version change and I like the idea of adding the necessary functionality here to a new function. 👍
Hi there - fantastic project!
I was wondering what your opinion was on relaxing the check to detect prior
mongoist
connections? In particular, this check will fail if themongoist
reference that is passed in is amongoist
reference where the module was loaded separately. This can happen either due to version differences, multiple linked packages during testing, or any other situation wheremongoist
isn't flattened to a single module under a package'snode_modules
. In this situation, the failure to detect the reference as aDatabase
reference means that we'll returnundefined
even though we had a valid connection that we could have used to make a new connection from.It's most likely too dangerous to reuse the connection if it was loaded via a different instance of the
mongoist
package as we can't be sure of API uniformity, but what do you think about using the passed inmongoist
reference in order to synthesize a newmongoist
reference?The text was updated successfully, but these errors were encountered: