Hi guys,
I’m currently learning how to work with yii2 + mongodb.
I already know how to insert a document using \yii\mongodb\collection, example :
$collection->insert(['name' => 'john'])
and know how to find a document, example :
$collection->find(['name' => 'john'])
But i’m stuck about how to call a mongodb function from yii2. Let say I already create this function in my mongodb :
db.system.js.save(
{
_id: "echoFunction",
value : function(x) { return x; }
}
)
How to call this function from yii2 ?
Any help would be appreciated. Thanks before