Skip to content

Populate sintax #26

Description

@oyepez003

Hi guys thanks for this project, it is amazing.

My Question is I can populate a child collection when the parent document has only ObjectId for relation.

Somthing like this:

type User struct {
...
Address bson.ObjectId `bson:"address"`
}

connection.Collection("user").Find(bson.M{"firstName":"Bob"}).Populate("messages")

Best regards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions