Thank you for responding although I don't think this answers my question.
Let me clarify; previously date objects were stored as MongoDate (sec => 1235, usec => 1235).
Now they are stored like ISOdate("yyyy-dd-mm").
I do not know what I did to trigger this alternative save method. Maybe the right question is "what do you have to pass a new MongoDate(xxx) object to return an ISOdate() object?
I should be able to reverse eng from there and correct.
Thanks
Sent from my iPhone
On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com> wrote:
Hi,
MongoDate[0] representes date objects for the database which are ISODates[1].
MongoDB has a "date" type. In PHP, this is deserialized to a
MongoDate. In the mongo shell, this is deserialized to ISODate. If
you're seeing ISODates in the shell, that is normal and how dates
should look in the shell. Are you seeing ISODate in PHP? If so, can
you paste a var_dump of the document?
On Oct 3, 6:18 pm, RJ Johnston <rj.johns...@monthsof.me> wrote:
> Thank you for responding although I don't think this answers my question.
> Let me clarify; previously date objects were stored as MongoDate (sec =>
> 1235, usec => 1235).
> Now they are stored like ISOdate("yyyy-dd-mm").
> I do not know what I did to trigger this alternative save method. Maybe the
> right question is "what do you have to pass a new MongoDate(xxx) object to
> return an ISOdate() object?
> I should be able to reverse eng from there and correct.
> Thanks
> Sent from my iPhone
> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com> wrote:
> Hi,
> MongoDate[0] representes date objects for the database which are
> ISODates[1].
> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com> > 3 de octubre de 2011 23:24
> Hello,
> I recently updated a library that uses PHP's MongoDate to store all > date related fields.
> After running the library I noticed MongoDate objects were no longer > being stored. Instead an ISOdate object is stored.
> Any idea's what I "accidentally" did to trigger the change?
> Thanks
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@googlegroups.com. > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en.
>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com> >> 3 de octubre de 2011 23:24
>> Hello,
>> I recently updated a library that uses PHP's MongoDate to store all >> date related fields.
>> After running the library I noticed MongoDate objects were no longer >> being stored. Instead an ISOdate object is stored.
>> Any idea's what I "accidentally" did to trigger the change?
>> Thanks
>> -- >> You received this message because you are subscribed to the Google Groups >> "mongodb-user" group. >> To post to this group, send email to mongodb-user@googlegroups.com. >> To unsubscribe from this group, send email to >> mongodb-user+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/mongodb-user?hl=en.
>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com> >>> 3 de octubre de 2011 23:24
>>> Hello,
>>> I recently updated a library that uses PHP's MongoDate to store all >>> date related fields.
>>> After running the library I noticed MongoDate objects were no longer >>> being stored. Instead an ISOdate object is stored.
>>> Any idea's what I "accidentally" did to trigger the change?
>>> Thanks
>>> -- >>> You received this message because you are subscribed to the Google Groups >>> "mongodb-user" group. >>> To post to this group, send email to mongodb-user@googlegroups.com. >>> To unsubscribe from this group, send email to >>> mongodb-user+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/mongodb-user?hl=en.
>>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com> >>>> 3 de octubre de 2011 23:24
>>>> Hello,
>>>> I recently updated a library that uses PHP's MongoDate to store all >>>> date related fields.
>>>> After running the library I noticed MongoDate objects were no longer >>>> being stored. Instead an ISOdate object is stored.
>>>> Any idea's what I "accidentally" did to trigger the change?
>>>> Thanks
>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "mongodb-user" group. >>>> To post to this group, send email to mongodb-user@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> mongodb-user+unsubscribe@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/mongodb-user?hl=en.
> > Basically it is better than the old date object
> > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:
> >> What I was meant to say on the end of that is that so long as they do not
> >> come out of your PHP script escaped everyhting is fine.
> >> If they do then there is something afoot that we need to get to the root
> >> of.
> >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:
> >>> ISO date is tz compliant, notice the format of the time when looking at
> >>> it in shell.
> >>> escaping is normal for BSON (think of JSON) arrays. Slashs is always a
> >>> bit of a problem.
> >>> How exactly are they being stored in your DB?
> >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me> wrote:
> >>>> No thoughts?
> >>>> I noticed another anomaly, all the "/" symbols are now escaped!
> >>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe
> >>>> related?
> >>>> Sent from my iPhone
> >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com> wrote:
> >>>> Hi,
> >>>> MongoDate[0] representes date objects for the database which are
> >>>> ISODates[1].
> >>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
> >>>> 3 de octubre de 2011 23:24
> >>>> Hello,
> >>>> I recently updated a library that uses PHP's MongoDate to store all
> >>>> date related fields.
> >>>> After running the library I noticed MongoDate objects were no longer
> >>>> being stored. Instead an ISOdate object is stored.
> >>>> Any idea's what I "accidentally" did to trigger the change?
> >>>> Thanks
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "mongodb-user" group.
> >>>> To post to this group, send email to mongodb-user@googlegroups.com.
> >>>> To unsubscribe from this group, send email to
> >>>> mongodb-user+unsubscribe@googlegroups.com.
> >>>> For more options, visit this group at
> >>>>http://groups.google.com/group/mongodb-user?hl=en.
Could you indicate which lib you're talking about ?
I'm interested in the way you managed to format the date on PHP side (to an ISODate) to upload in Mongo DB BSON ISODate format.
Thanks for your kind help,
Le mardi 4 octobre 2011 22:14:57 UTC+2, Sammaye a écrit :
>> Basically it is better than the old date object
>> On 4 October 2011 21:02, Sam Millman <sam.m...@gmail.com <javascript:>>wrote:
>>> What I was meant to say on the end of that is that so long as they do >>> not come out of your PHP script escaped everyhting is fine.
>>> If they do then there is something afoot that we need to get to the root >>> of.
>>> On 4 October 2011 20:59, Sam Millman <sam.m...@gmail.com <javascript:>>wrote:
>>>> ISO date is tz compliant, notice the format of the time when looking at >>>> it in shell.
>>>> escaping is normal for BSON (think of JSON) arrays. Slashs is always a >>>> bit of a problem.
>>>> How exactly are they being stored in your DB?
>>>> On 4 October 2011 20:42, RJ Johnston <rj.jo...@monthsof.me<javascript:>
>>>> > wrote:
>>>>> No thoughts?
>>>>> I noticed another anomaly, all the "/" symbols are now escaped! >>>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe >>>>> related?
>>>>> Sent from my iPhone
>>>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flap...@gmail.com<javascript:>> >>>>> wrote:
>>>>> Hi,
>>>>> MongoDate[0] representes date objects for the database which are >>>>> ISODates[1].
>>>>> <compose-unknown-contact.jpg>RJ <javascript:>
>>>>> 3 de octubre de 2011 23:24
>>>>> Hello,
>>>>> I recently updated a library that uses PHP's MongoDate to store all
>>>>> date related fields.
>>>>> After running the library I noticed MongoDate objects were no longer
>>>>> being stored. Instead an ISOdate object is stored.
>>>>> Any idea's what I "accidentally" did to trigger the change?
>>>>> Thanks
>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "mongodb-user" group.
>>>>> To post to this group, send email to mongod...@googlegroups.com<javascript:>
>>>>> .
>>>>> To unsubscribe from this group, send email to >>>>> mongodb-user...@googlegroups.com <javascript:>.
>>>>> For more options, visit this group at >>>>> http://groups.google.com/group/mongodb-user?hl=en.
> Adding a time() arg to the class call will set the date to that time.
> On 16 September 2012 23:44, KevOu <kevin.chi...@gmail.com> wrote:
>> Sam,
>> Sorry I don't know if my previous message went through...
>> Would you know the best way to "prepare" a php date to upload to mongo
>> db ISODate format ?
>> You said date() object is dead so which one do you suggest to use ?
>> Thanks for your kind help,
>> On 4 oct 2011, 22:14, Sam Millman <sam.mill...@gmail.com> wrote:
>> > Ha!
>> > I only just noticed the original question:
>> > "Any idea's what I "accidentally" did to trigger the change?"
>> > Answer: You upgraded.
>> > The old date() object is dead. You need not do anything different it
>> will
>> > just make the date storing in the DB better.
>> > On 4 October 2011 21:07, Sam Millman <sam.mill...@gmail.com> wrote:
>> > > Basically it is better than the old date object
>> > > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:
>> > >> What I was meant to say on the end of that is that so long as they
>> do not
>> > >> come out of your PHP script escaped everyhting is fine.
>> > >> If they do then there is something afoot that we need to get to the
>> root
>> > >> of.
>> > >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:
>> > >>> ISO date is tz compliant, notice the format of the time when
>> looking at
>> > >>> it in shell.
>> > >>> escaping is normal for BSON (think of JSON) arrays. Slashs is
>> always a
>> > >>> bit of a problem.
>> > >>> How exactly are they being stored in your DB?
>> > >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me>
>> wrote:
>> > >>>> No thoughts?
>> > >>>> I noticed another anomaly, all the "/" symbols are now escaped!
>> > >>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe
>> > >>>> related?
>> > >>>> Sent from my iPhone
>> > >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com>
>> wrote:
>> > >>>> Hi,
>> > >>>> MongoDate[0] representes date objects for the database which are
>> > >>>> ISODates[1].
>> > >>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
>> > >>>> 3 de octubre de 2011 23:24
>> > >>>> Hello,
>> > >>>> I recently updated a library that uses PHP's MongoDate to store all
>> > >>>> date related fields.
>> > >>>> After running the library I noticed MongoDate objects were no
>> longer
>> > >>>> being stored. Instead an ISOdate object is stored.
>> > >>>> Any idea's what I "accidentally" did to trigger the change?
>> > >>>> Thanks
>> > >>>> --
>> > >>>> You received this message because you are subscribed to the Google
>> > >>>> Groups "mongodb-user" group.
>> > >>>> To post to this group, send email to mongodb-user@googlegroups.com
>> .
>> > >>>> To unsubscribe from this group, send email to
>> > >>>> mongodb-user+unsubscribe@googlegroups.com.
>> > >>>> For more options, visit this group at
>> > >>>>http://groups.google.com/group/mongodb-user?hl=en.
> Adding a time() arg to the class call will set the date to that time.
> On 16 September 2012 23:44, KevOu <kevin.chi...@gmail.com> wrote:
> Sam,
> Sorry I don't know if my previous message went through...
> Would you know the best way to "prepare" a php date to upload to mongo
> db ISODate format ?
> You said date() object is dead so which one do you suggest to use ?
> Thanks for your kind help,
> On 4 oct 2011, 22:14, Sam Millman <sam.mill...@gmail.com> wrote:
> > Ha!
> > I only just noticed the original question:
> > "Any idea's what I "accidentally" did to trigger the change?"
> > Answer: You upgraded.
> > The old date() object is dead. You need not do anything different it will
> > just make the date storing in the DB better.
> > On 4 October 2011 21:07, Sam Millman <sam.mill...@gmail.com> wrote:
> > > Basically it is better than the old date object
> > > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:
> > >> What I was meant to say on the end of that is that so long as they do not
> > >> come out of your PHP script escaped everyhting is fine.
> > >> If they do then there is something afoot that we need to get to the root
> > >> of.
> > >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:
> > >>> ISO date is tz compliant, notice the format of the time when looking at
> > >>> it in shell.
> > >>> escaping is normal for BSON (think of JSON) arrays. Slashs is always a
> > >>> bit of a problem.
> > >>> How exactly are they being stored in your DB?
> > >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me> wrote:
> > >>>> No thoughts?
> > >>>> I noticed another anomaly, all the "/" symbols are now escaped!
> > >>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe
> > >>>> related?
> > >>>> Sent from my iPhone
> > >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com> wrote:
> > >>>> Hi,
> > >>>> MongoDate[0] representes date objects for the database which are
> > >>>> ISODates[1].
> > >>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
> > >>>> 3 de octubre de 2011 23:24
> > >>>> Hello,
> > >>>> I recently updated a library that uses PHP's MongoDate to store all
> > >>>> date related fields.
> > >>>> After running the library I noticed MongoDate objects were no longer
> > >>>> being stored. Instead an ISOdate object is stored.
> > >>>> Any idea's what I "accidentally" did to trigger the change?
> > >>>> Thanks
> > >>>> --
> > >>>> You received this message because you are subscribed to the Google
> > >>>> Groups "mongodb-user" group.
> > >>>> To post to this group, send email to mongodb-user@googlegroups.com.
> > >>>> To unsubscribe from this group, send email to
> > >>>> mongodb-user+unsubscribe@googlegroups.com.
> > >>>> For more options, visit this group at
> > >>>>http://groups.google.com/group/mongodb-user?hl=en.
Yea MongoDate can take a tz, it will default it down to Z time with a +
notation for the tz but you must set the PHP timezone to be that tz in
order for it to work.
On 17 September 2012 08:07, Kevin Childs <kevin.chi...@gmail.com> wrote:
>> Adding a time() arg to the class call will set the date to that time.
>> On 16 September 2012 23:44, KevOu <kevin.chi...@gmail.com> wrote:
>>> Sam,
>>> Sorry I don't know if my previous message went through...
>>> Would you know the best way to "prepare" a php date to upload to mongo
>>> db ISODate format ?
>>> You said date() object is dead so which one do you suggest to use ?
>>> Thanks for your kind help,
>>> On 4 oct 2011, 22:14, Sam Millman <sam.mill...@gmail.com> wrote:
>>> > Ha!
>>> > I only just noticed the original question:
>>> > "Any idea's what I "accidentally" did to trigger the change?"
>>> > Answer: You upgraded.
>>> > The old date() object is dead. You need not do anything different it
>>> will
>>> > just make the date storing in the DB better.
>>> > On 4 October 2011 21:07, Sam Millman <sam.mill...@gmail.com> wrote:
>>> > > Basically it is better than the old date object
>>> > > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:
>>> > >> What I was meant to say on the end of that is that so long as they
>>> do not
>>> > >> come out of your PHP script escaped everyhting is fine.
>>> > >> If they do then there is something afoot that we need to get to the
>>> root
>>> > >> of.
>>> > >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:
>>> > >>> ISO date is tz compliant, notice the format of the time when
>>> looking at
>>> > >>> it in shell.
>>> > >>> escaping is normal for BSON (think of JSON) arrays. Slashs is
>>> always a
>>> > >>> bit of a problem.
>>> > >>> How exactly are they being stored in your DB?
>>> > >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me>
>>> wrote:
>>> > >>>> No thoughts?
>>> > >>>> I noticed another anomaly, all the "/" symbols are now escaped!
>>> > >>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe
>>> > >>>> related?
>>> > >>>> Sent from my iPhone
>>> > >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com>
>>> wrote:
>>> > >>>> Hi,
>>> > >>>> MongoDate[0] representes date objects for the database which are
>>> > >>>> ISODates[1].
>>> > >>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
>>> > >>>> 3 de octubre de 2011 23:24
>>> > >>>> Hello,
>>> > >>>> I recently updated a library that uses PHP's MongoDate to store
>>> all
>>> > >>>> date related fields.
>>> > >>>> After running the library I noticed MongoDate objects were no
>>> longer
>>> > >>>> being stored. Instead an ISOdate object is stored.
>>> > >>>> Any idea's what I "accidentally" did to trigger the change?
>>> > >>>> Thanks
>>> > >>>> --
>>> > >>>> You received this message because you are subscribed to the Google
>>> > >>>> Groups "mongodb-user" group.
>>> > >>>> To post to this group, send email to
>>> mongodb-user@googlegroups.com.
>>> > >>>> To unsubscribe from this group, send email to
>>> > >>>> mongodb-user+unsubscribe@googlegroups.com.
>>> > >>>> For more options, visit this group at
>>> > >>>>http://groups.google.com/group/mongodb-user?hl=en.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
> Yea MongoDate can take a tz, it will default it down to Z time with a + notation for the tz but you must set the PHP timezone to be that tz in order for it to work.
> On 17 September 2012 08:07, Kevin Childs <kevin.chi...@gmail.com> wrote:
> I saw that, but MongoDate constructor doesn't manage TZ although ISODate does :-)
> Kev
> Le 17 sept. 2012 à 01:20, Sam Millman <sam.mill...@gmail.com> a écrit :
>> Forwarding back down to mongodb-user. Poster accidently posted directly to me.
>> Adding a time() arg to the class call will set the date to that time.
>> On 16 September 2012 23:44, KevOu <kevin.chi...@gmail.com> wrote:
>> Sam,
>> Sorry I don't know if my previous message went through...
>> Would you know the best way to "prepare" a php date to upload to mongo
>> db ISODate format ?
>> You said date() object is dead so which one do you suggest to use ?
>> Thanks for your kind help,
>> On 4 oct 2011, 22:14, Sam Millman <sam.mill...@gmail.com> wrote:
>> > Ha!
>> > I only just noticed the original question:
>> > "Any idea's what I "accidentally" did to trigger the change?"
>> > Answer: You upgraded.
>> > The old date() object is dead. You need not do anything different it will
>> > just make the date storing in the DB better.
>> > On 4 October 2011 21:07, Sam Millman <sam.mill...@gmail.com> wrote:
>> > > Basically it is better than the old date object
>> > > On 4 October 2011 21:02, Sam Millman <sam.mill...@gmail.com> wrote:
>> > >> What I was meant to say on the end of that is that so long as they do not
>> > >> come out of your PHP script escaped everyhting is fine.
>> > >> If they do then there is something afoot that we need to get to the root
>> > >> of.
>> > >> On 4 October 2011 20:59, Sam Millman <sam.mill...@gmail.com> wrote:
>> > >>> ISO date is tz compliant, notice the format of the time when looking at
>> > >>> it in shell.
>> > >>> escaping is normal for BSON (think of JSON) arrays. Slashs is always a
>> > >>> bit of a problem.
>> > >>> How exactly are they being stored in your DB?
>> > >>> On 4 October 2011 20:42, RJ Johnston <rj.johns...@monthsof.me> wrote:
>> > >>>> No thoughts?
>> > >>>> I noticed another anomaly, all the "/" symbols are now escaped!
>> > >>>> (http:\/\/someurl.com). Cannot figure this out either. Maybe
>> > >>>> related?
>> > >>>> Sent from my iPhone
>> > >>>> On Oct 3, 2011, at 5:30 PM, Flavio Percoco <flape...@gmail.com> wrote:
>> > >>>> Hi,
>> > >>>> MongoDate[0] representes date objects for the database which are
>> > >>>> ISODates[1].
>> > >>>> <compose-unknown-contact.jpg>RJ <rjdjohns...@gmail.com>
>> > >>>> 3 de octubre de 2011 23:24
>> > >>>> Hello,
>> > >>>> I recently updated a library that uses PHP's MongoDate to store all
>> > >>>> date related fields.
>> > >>>> After running the library I noticed MongoDate objects were no longer
>> > >>>> being stored. Instead an ISOdate object is stored.
>> > >>>> Any idea's what I "accidentally" did to trigger the change?
>> > >>>> Thanks
>> > >>>> --
>> > >>>> You received this message because you are subscribed to the Google
>> > >>>> Groups "mongodb-user" group.
>> > >>>> To post to this group, send email to mongodb-user@googlegroups.com.
>> > >>>> To unsubscribe from this group, send email to
>> > >>>> mongodb-user+unsubscribe@googlegroups.com.
>> > >>>> For more options, visit this group at
>> > >>>>http://groups.google.com/group/mongodb-user?hl=en.
> -- > You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
> -- > You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb