Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: MongoDB replacing an array

by Mr. Muskrat (Canon)
on Aug 26, 2012 at 17:38 UTC ( #989854=note: print w/replies, xml ) Need Help??


in reply to MongoDB replacing an array

I don't use MongoDB so bear with me. Has this sort of update worked before? I ask because it looks like you update timestamps with a DateTime object, not an array, as shown in the MongoDB module's DataTypes documentation section on Dates.

Replies are listed 'Best First'.
Re^2: MongoDB replacing an array
by neilwatson (Priest) on Aug 26, 2012 at 17:43 UTC

    Timestamp is name of an array in a JSON inside a MongoDB database. I want to replace that entire array with a new one. My backup plan is to empty the array in MongoDB and then insert a new one.

    Neil Watson
    watson-wilson.ca

      And you're sure that @new is not empty at the point of the insert? Have you tried printing out its contents to be sure?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989854]
help
Chatterbox?
Eily used google. The lazy internet equivalent of grep
[karlgoethebier]: He!
[Eily]: Discipulus pretty much all oneliners are killing. Do you imagine how many people could be working if you asked them to do the same thing in C each time ? :P
Eily is Listening to "Leave out all the rest" by Linkin Park
[karlgoethebier]: that's why trade unions like C ;-)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-07-21 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (320 votes). Check out past polls.