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

CascadeSave should sync #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

CascadeSave should sync #40

wants to merge 3 commits into from

Conversation

wxf4150
Copy link

@wxf4150 wxf4150 commented Feb 28, 2019

this commit fixes #36

@wxf4150
Copy link
Author

wxf4150 commented Feb 28, 2019

DocumentBase fields should omitempty; then the sub struct can used as bongo.Find param.


type User struct {
	bongo.DocumentBase `bson:",inline"`
	UserName     string `example:"wxf"`
	Password string `json:"-" example:"111111"  bson:",omitempty"`
	Phone string ` bson:",omitempty"`
	Email string ` bson:",omitempty"`
}
u:=new(User)
err:=bgoUser.FindOne(bson.M{"username":uname},u)  

err:=bgoUser.FindOne(User{UserName:uname},u)  // if DocumentBase fields  bson omitempty;  then this line will work too.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.02%) to 84.064% when pulling 6721120 on wxf4150:master into 761759e on go-bongo:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.02%) to 84.064% when pulling 6721120 on wxf4150:master into 761759e on go-bongo:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.02%) to 84.064% when pulling 6721120 on wxf4150:master into 761759e on go-bongo:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.02%) to 84.064% when pulling 6721120 on wxf4150:master into 761759e on go-bongo:master.

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

Successfully merging this pull request may close these issues.

Collection.Save CascadeSave bug
2 participants