Dear friends,
I’m trying to work on building on my own custom script for further flexibilities with the use of mongodb connection. There are who simple task I would like to try, but I fail to start with some simple scripting (Sorry for being such a newbie here). What I try to accomplish is to get a count of total documents search by user email and also try extract timestamp off document ids. Below are the following scripts that I tried to create with server-side scripting. Any quick direction or example it would be great, thanks!
This is what I tried to attempt getting some script working for acquiring object id timestamps… by run either the following directly… please advise better method
var get_ts = db.comments.find({_id: {$gt: ObjectId(“5272e0f00000000000000000”)}});
or
if(event.response.resource) {
var myparam = {
“filter”: “_id=” + record.objectId,
}
var result = platform.api.get(“mongodb/_table/bigtable”, myparam);
record.from_mongo = result.content.resource[0].objectId;
var result = function (objectId) {
return new Date(parseInt(objectId.substring(0, 8), 16) * 1000);
};
}
And also I would like to run -> db.collection.find(query).count() as well by table