Hi Marcel,

I haven't used "new Date" in that context, but you could see if you have better results with "parseDateTime(dateString)". So in your example you can try:

<cfset MongoCollectionupdate(datasource="test", collection="users", query=({_id:"#MongoObjectid(form.update)#"}), data=({
username:"#trim(form.username)#",
password:"#enc_pw#",
changedate: parseDateTime(iChangeDate)
}))>

There could be an issue depending on where the date string is coming from, it probably won't parse every possible date format, but you can check out a few options for the function here: http://openbd.org/manual/?/function/parsedatetime

Jamie.



On 08/11/2012 21:06, Marcel Plate wrote:
I have some problems to update or insert a MongoDB-Date using MongoCollectionupdate or MongoCollectioninsert.

<cfset MongoCollectionupdate(datasource="test", collection="users", query=({_id:"#MongoObjectid(form.update)#"}), data=({
username:"#trim(form.username)#",
password:"#enc_pw#",
changedate: new Date(#iChangeDate#)
}))>

When I run MongoCollectionupdate with changedate as a string, there is no problem. But I need the Date-Type. Any ideas?

Btw: Thanks for OpenBD!!!
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en


--
aw2.0
  http://www.aw20.co.uk/

--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

Reply via email to