Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Add date convert #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yacthMon
Copy link

@yacthMon yacthMon commented Apr 8, 2019

I just add date convert, So lua script can update or insert date via os.time()
with format "day(" .. os.time() .. ")".

Example

exports.mongodb:updateOne({
   collection="users",
   query = { _id = result[1]._id },
   update = { ["$set"] = {  last_login = "day(" .. os.time() .. ")" } } 
})

This will convert last_login from "day(1554755493)" to ISODate('2019-04-08T20:31:33.000Z').

Hope this will improve this resource.

PS. I apologize if there are any errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant