Skip to content
Newer
Older
100644 41 lines (35 sloc) 1.27 KB
8d87fc1 @pifantastic Added a bit to readme
authored Jul 8, 2010
1 # JetStream
2
3 JetStream tries to bring the beauty and simplicity of the the jQuery API to databases.
4
ef3ab00 @pifantastic rearranged things so I can start adding qunit tests and executing wit…
authored Jul 8, 2010
5 // Get all users who are older than 20 years.
6 var adults = jet('users').filter(function(user) {
7 return (user.age > 20);
8 });
9 console.log(adults);
10
11 // Get all users and print their ages
12 jet('users').each(function(i, v) {
13 console.log(v.name + " is " + v.age + " years old.");
14 });
15
16 // Get all users who are in their twenties
17 console.log("********** These users are in their twenties ***********");
18 jet('users').filter(function(user) {
19 return (user.age >= 20 && user.age <= 29);
20 }).each(function(i, user) {
21 console.log(user.name);
22 });
23
24 // Show all users
25 console.log("********** This is all of the users ***********");
26 jet('users').each(function(i, user) {
27 console.log(user.name);
28 });
29
30 // Expressions
31 console.log("********** Expressions ***********");
32 // Contains
33 console.log(jet("users[name*=Aaron]").get());
34 // Ends with
35 console.log(jet("users[name$=Aaron]").get());
36 // Equals
37 console.log(jet("users[name=Aaron]").get());
38 // Not equal
39 console.log(jet("users[name!=Aaron]").get());
40 // Starts with
41 console.log(jet("users[name^=Aaron]").get());
Something went wrong with that request. Please try again.