Hi, this is my first question here so I'm sorry if it isn't clear or something.

I've been using an online "server" from parse, and they have some "cloud code" for which you can write in javascript.
Not being a total expert in js I somehow got stuck, and it has to do with global variables and alike.

The code goes like this:

Code:
var json={};
var query = new Parse.Query("Question");
    query.equalTo("imi", imi);
   query.find(
	{
		success: function(results) {
			json.imi=results[0].imi;
		},
		error: function() {
		
		}
		});
Now note what I was trying to do, I wanted to add imi to json object, but somehow it doesn't work. I really don't know where the new json.imi goes to but this code normally works, and I've been through many forums and seen that my coding is OK.
Now, since this query.find is somewhat of an unknown to me (I don't know what kind of a function this is) I really don't know how I could define these objects so they would work.

P.S.
defining var json as window.json doesn't work as this is not a webpage (atleast I think it's because of that).