|
Project Information
Members
|
Bzoo is an AS3 database for flash. The library provides a thin data layer for flash/flex applications or websites, allowing data manipulation and persistence . It is an indirect AS3 translation of the javascript library Taffy DB Bzoo works like a temp or persistent database for flash, implementing the CRUD interface:
Bzoo takes amf array collections, JSON strings and YAML strings. JSON and YAML will be automatically parsed and made available. By using the persistent attribute, Bzoo will allow data to be retained in Shared Objects for automatic retrieval after refresh, in other words bzoo allows you to store your data on the client machine. Bzoo makes the use of: - JSON decoder classes from the as3corelib - Derek Wischusen's as3yaml decoder that can be found at as3yaml Please submit any bugs that you find to the issues list on the google project site Check out a working Bzoo Example Example: import com.rtistique.bzoo.Bzoo; Find all friends that are 29 years old: var result:Object = friends.find("all", {
conditions :[{ field:"age", equal:"29"}]);
Find only the name and the state for friends that are older than 21 and sort the result by ascending "state" values: var result:Object = bzoo.find("all", {
fields :["name", "state"],
conditions:[{ field:"age", greaterThan:"21"}],
orderBy :{ field :"state", order:Bzoo.ASCENDING} } );
Find the first friend that is 29 years old: var result:Object = friends.find("first", {
conditions:{ field:"age", equal:"29" } } );
Find the number of friends that are 29 years old: var result:Object = bzoo.find(Bzoo.FIND_COUNT, { conditions:{ field:"age", equal:"29" } } );
Add a new friend to the list: var result:Object = friends.insert( { name :"Bachir",
gender :"M",
married:"YES",
age : 28,
state :"NSW",
favorite_food:["Moussaka", "Noodles"] });
Update a friend's details: friends.update( {conditions:{field:"name", equal:"Sarah"}},
{field:"name", equal:"Bachir"});
Delete a friend from the list: friends.remove({conditions:{field:"age", equal:"29"}});
Delete a friend by index: friends.removeByIndex(1); |