I tried both:
var esc_regCollection = Spark.runtimeCollection("ESCReg"); var playerIDs = []; for( var it = 0; it < esc_regCollection.count(); ++it ){ // [] invalid var regPlayer = esc_regCollection[it]; playerIDs.push(regPlayer._id); } // hasNext invalid while( esc_regCollection.hasNext()){ var regPlayer = esc_regCollection.next(); playerIDs.push(regPlayer._id); }
Hi Giuliano
You just need to add a find query to get a SparkMongoCursor
This code will work
var esc_regCollection = Spark.runtimeCollection("ESCReg").find();
var playerIDs = [];
while( esc_regCollection.hasNext()){
var regPlayer = esc_regCollection.next();
playerIDs.push(regPlayer._id);
}
Regards
Katie
Giuliano Suminsky
I tried both:
Hi Giuliano
You just need to add a find query to get a SparkMongoCursor
This code will work
var esc_regCollection = Spark.runtimeCollection("ESCReg").find();
var playerIDs = [];
while( esc_regCollection.hasNext()){
var regPlayer = esc_regCollection.next();
playerIDs.push(regPlayer._id);
}
Regards
Katie
Customer Support
Hi Giuliano
You just need to add a find query to get a SparkMongoCursor
This code will work
var esc_regCollection = Spark.runtimeCollection("ESCReg").find();
var playerIDs = [];
while( esc_regCollection.hasNext()){
var regPlayer = esc_regCollection.next();
playerIDs.push(regPlayer._id);
}
Regards
Katie
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics