Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: MongoDB insert order

by derby (Abbot)
on May 30, 2012 at 14:59 UTC ( #973312=note: print w/ replies, xml ) Need Help??


in reply to MongoDB insert order

Laying aside that this may be a mongoDB internals issue, and laying aside possible Denial of Service attacks with deterministic keys, I'd have to ask "why does it even matter?"

-derby


Comment on Re: MongoDB insert order
Re^2: MongoDB insert order
by PhilipJ (Initiate) on May 30, 2012 at 15:07 UTC
    I have javascript manipulating the results of a mongoDB find() and, while I could, of course, edit this so it were not the case, the script currently depends on the String input from the find() being in a specific order. That and it just seems like this should be an easy thing to do.

      Hmmm ... well ... it's not as easy as you think. It would mean that perl and mongo would share the same or similar associative array implementations. Even if they did, then your approach would never work 100% since perl does not even promise the key order will be the same in different processes.

      Did you mean "String *output* from find"? If so, you're probably better of converting the JSON returned from the find into a true JS object and manipulating it that way instead of doing any string manipulation on the results.

      -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2014-10-20 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (76 votes), past polls