Sign In Register

How can we help you today?

Start a new topic
Answered

MongoDB synchronicity question

If I do:


player.SetSegment ("A", "Low");


and immediately after:


var segments = player.getSegments ();


1) I'm guaranteed to get { "A": "Low" } in segments, right? It's this way in my tests, but I just wanted to make sure that this is a guarantee and MongoDB won't handle the request asynchronously in some cases. 


2) Also, the same question, for the case of a random MongoDB update command on a runtime collection.



Thanks,

Baris


Best Answer
Hey Baris,

This is the behavior you can expect from your question above so please let us know if you notice a problem with it.

Thanks,
Sean

 


Hi Baris,


In both cases I believe the answer is yes.
Will investigate further.


Thanks,


Oisin

Answer
Hey Baris,

This is the behavior you can expect from your question above so please let us know if you notice a problem with it.

Thanks,
Sean

 

Thanks Oisin, a definitive answer would be great. 

I use things like "var segments = player.getSegments ();" in modules, so that the module is independent of the script using the module, but I always worry about this a bit.

Login to post a comment