No no :P I thought I was kind of clear... if I have 

str_document = {
 foo: bar,
 bar: java object(foo)
}

And I want to get

 var bar = java object(foo);
 str_document = {
  foo:bar
 }

Then there seems to be no way to achieve this without making an entirely 
new java object (be it with mongoobjectid or createObject) and deleting the 
original (because of the reasons I outlined in the original post).

 Greetings,
  David Mulder

On Thursday, April 4, 2013 3:08:37 PM UTC+2, Alan Williamson wrote:
>
>  You have confused me to as what you are trying to do.
>
> Are you maybe needing to use:
>
> http://openbd.org/manual/?/function/mongoobjectid
>
> On 04/04/2013 09:00, David Mulder wrote:
>  
> Let's say I have a mongodb document with a _id java object inside, for 
> some reason you need to use the mongodbupdate function rather than 
> mongodbsave, so you need to remove the _id from the document and place it 
> in the query structure... and then you get hit by the by reference nature 
> of java/openbd. 
>
>   - You can't set it to some variable and next remove it from the 
> original struct, as that will remove it from the variable as well.
>  - You can't make a duplicate of the objectId object, as java objects can 
> be duplicated.
>  - You can't clone it, as the object has no clone function.
>  - The only solution (currently in use) is to .toString() it and next make 
> an entirely new object passing the string to it's constructor (bleh).
>
>  So I was wondering, isn't there a better way? In this case making the 
> duplicate doesn't cost *that *much, but it still feels wrong. And 
> assuming there isn't a better way, wouldn't it be good then to have a 
> StructExtract function (or similar) which takes the item out of the 
> original struct (or have structDelete return the object if the third 
> argument is "extract"). Well, might be there's a cleaner solution, but I 
> don't see it at least.
>
>   Greetings,
>  
>
>  

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

--- 
You received this message because you are subscribed to the Google Groups "Open 
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to