B4J Question MONGO DateField

alienhunter

Active Member
Licensed User
Longtime User
Hi To All
how to add a date filed in mongo instead of a string date ?

date insert:
                    jobs.Insert(Array(CreateMap("machineid": portmachine,"machinename": namemachine, _
                        "machinedate": DateTime.Now ,"machinehour":hourstring1,"speedover":speedoverride,"feedover":feedoverride,"rapidover":rapidoverride, _
                        "actualspeed":actspeed,"actualfeed":actfeed)))

thank you very much Alfred
 

Attachments

  • datefield.PNG
    datefield.PNG
    8.5 KB · Views: 110

alienhunter

Active Member
Licensed User
Longtime User
Hi Erel
jobs is the Collection (table)
"db.example.insert({"date":ISODate("2016-03-03T08:00:00.000")});"
sorry i do not know how send this ISO stuff

B4X:
    mongo.Initialize("", "mongodb://10.0.2.7")
    poolconnection
    db = mongo.GetDatabase("ias")
    momgolist.Initialize
'
    jobs = db.GetCollection(jonbrstr)
    jobs.CreateIndex(CreateMap("machineid": 1))

note: this mongo stuff if awsome i love it how it works in b4x
thank you
 
Upvote 0

alienhunter

Active Member
Licensed User
Longtime User
Thank you very much Erel
This is awesome , this worked
the field is a Date
Alfred
 

Attachments

  • mongodate.PNG
    mongodate.PNG
    7.7 KB · Views: 106
Upvote 0
Top