I have been searching the net for some examples of how to use indexes, but I can't find any that fit my case (or maybe I just don't get them yet).
lets say I have a table "Objects" with three properties.
owner:String
canCopy:Boolean
image:ByteArray
I have created an index called ownerCanCopy
ownerCanCopy (edit index, delete) Status from 8 hours ago: 2 entries total using 102 bytes
owner (String, Ascending)
copy (Boolean, Ascending)
now I want to filter the results where
owner = "Bob" and canCopy = true;
var canCopy:Boolean = true;
PlayerIO.BigDB.loadRange( "Objects"
, "ownerCanCopy"
, ["Bob"]
, canCopy
, null
, 100
, some function...
, some function... );
works, but if I set canCopy to false.
I get back both the true AND false result.
Why is that???
examples show
//Load all users from Paris that are 30 years old, and were created in April
PlayerIO.BigDB.LoadRange("Users", "ByLocationAgeCreated",
new object[]{"Paris", 30}, new DateTime(2010, 4, 1),
new DateTime(2010, 4, 30), 100,
delegate(DatabaseObject[] result) {
//...
}
);
and if I try to create an object to pass in, I get an error.
[{owner:"Bob", copy:true}]
Results in
Error: Property no. 1 in index 'ownerCanCopy' is of type: String, and not of type: Obj
So I can make this work for 2 indexes, if I only need the cases where it is true.
Why can't I pass in a compound index in the $path like they show in the examples?
Also what if I had 3 fields in my index? How would you access that?