I'm using globalsign/mgo and in a request I need to use a function :
function(){return this.image.test('%s')}
// request that I want
db.getCollection('commands').find(function() { return this.image.test('%s'); })
I tried like that:
err = r.coll.Find(fmt.Sprintf("function(){return this.image.test('%s')}", image)).One(&t)
But it required a Bson object :
Failed to parse: filter: "function(){return this.image.test('sonarqube%3A6.5-1')}". 'filter' field must be of BSON type object.
Does someone know how to do it ?
Thanks