Conversation
| if strings.HasPrefix(p.conf.SchemaPath, "example.json") { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
why do we need to skip watcher for unit test?
There was a problem hiding this comment.
if not skip, unit test will stuck on watcher. Cuz watcher is setup on Configure func, and unit test also need call this func: https://github.com/wish/mongoproxy/blob/master/pkg/mongoproxy/plugins/schema/schema_test.go#L19-L21
There was a problem hiding this comment.
my understanding is that watcher should not be blocking, it's a async go routing
the whole mongoproxy service will be continuously running to serve requests, but this watcher function should not be a blocking one
| return err | ||
| } | ||
|
|
||
| <-done |
There was a problem hiding this comment.
have we tested it with sending queries to local mongodb? if my reading/understanding is correct, this done will block SchemaPlugin.Configure() return, thus no query could be processed?
fix issue:
https://logicians.slack.com/archives/C0133DZ2WE8/p1658528214943319
in mongodb $addToSet and $push command support each operator:
https://www.mongodb.com/docs/manual/reference/operator/update/addToSet/#-each-modifier
https://www.mongodb.com/docs/manual/reference/operator/update/push/#modifiers