I want to run MongoDB raw query directly from PHP.
My query is like below.
var document_id = db.Document.aggregate([{$project: {"creationDate":1,'_id':1}},{$match: {"_id":ObjectID("5aa7a8852f4b3e2e86004837")}}]).toArray();
document_id = document_id[0]['_id'];
var upload_id = db.Upload.aggregate([{$project: {"creationDate":1,'_id':1}},{$match: {"_id":ObjectID("5aa7a8852f4b3e2e86004837")}}]).toArray();
upload_id = upload_id[0]['_id'];
and get result of those two variable document_id & upload_id of concat or multiple or addition.
( FYI: In real, I won't concat or multiply ids it is just for example. )
I have checked "http://php.net/manual/en/book.mongodb.php" for reference but nothing found useful.
Can anyone guide me on that ?
Version of MongoDB & PHP MongoDB driver I am using.
MongoDB version 3.6
MongoDB PHP Driver version 1.5