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

Projection on a @DBRef field is not working #350

Open
SSaev opened this issue Aug 2, 2018 · 0 comments
Open

Projection on a @DBRef field is not working #350

SSaev opened this issue Aug 2, 2018 · 0 comments

Comments

@SSaev
Copy link

SSaev commented Aug 2, 2018

Hi guys,
I have the following documents and collections:
collection1:

{
    "_id" : ObjectId("59527c0189672c558385773a"),
    "_class": "collection1",
   "simpleField":"simpleFieldValue"
}

collection2:

{
    "_id" : ObjectId("59527c0189672c558385773c"),
    "collection1Object" : {
        "$ref" : "collection1",
        "$id" : ObjectId("59527c0189672c558385773a")
    }
}

When I do a projection on a real mongo instance like:
db.getCollection('collection2').find({_id: ObjectId("59527c0189672c558385773c")}, {"collection1Object.$id" : 1}) I get the correct collection2 object with collection1Object variable being resolved.
Unfortunately this is not working in fongo and my collection1Object is being resolved to null

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

No branches or pull requests

1 participant