Skip to content

Instantly share code, notes, and snippets.

@jwage
Created June 11, 2010 18:45
Show Gist options
  • Save jwage/434878 to your computer and use it in GitHub Desktop.
Save jwage/434878 to your computer and use it in GitHub Desktop.
find all Documents\User where username = 'jwage' and password = 'changeme'
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => jwage
[password] => changeme
)
[hydrate] => 1
)
find all Documents\User where username = :username
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => jwage
)
[hydrate] => 1
)
find all Documents\User where username != 'jwage' and username != 'ok'
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => Array
(
[$ne] => Array
(
[0] => jwage
[1] => ok
)
)
)
[hydrate] => 1
)
find all Documents\User reduce 'function () { return thisa == 3 || thisb == 4; }'
Array
(
[className] => Documents\User
[type] => 1
[hydrate] => 1
[mapReduce] => Array
(
[reduce] => function () { return thisa == 3 || thisb == 4; }
)
)
find all Documents\User map 'function () { return 1; }' reduce 'function () { return thisa == 3 || thisb == 4; }'
Array
(
[className] => Documents\User
[type] => 1
[hydrate] => 1
[mapReduce] => Array
(
[map] => function () { return 1; }
[reduce] => function () { return thisa == 3 || thisb == 4; }
)
)
insert Documents\User set username = 'jwage', password = 'changeme'
Array
(
[className] => Documents\User
[type] => 2
[newObj] => Array
(
[username] => jwage
[password] => changeme
)
[hydrate] => 1
)
find all Documents\User sort username asc, email desc
Array
(
[className] => Documents\User
[type] => 1
[sort] => Array
(
[username] => 1
[email] => -1
)
[hydrate] => 1
)
find all Documents\User sort username asc limit 10
Array
(
[className] => Documents\User
[type] => 1
[sort] => Array
(
[username] => 1
)
[limit] => 10
[hydrate] => 1
)
find all Documents\User sort username asc skip 30 limit 10
Array
(
[className] => Documents\User
[type] => 1
[sort] => Array
(
[username] => 1
)
[limit] => 10
[skip] => 30
[hydrate] => 1
)
remove Documents\User where username = 'jwage'
Array
(
[className] => Documents\User
[type] => 4
[where] => Array
(
[username] => jwage
)
[hydrate] => 1
)
update Documents\User set username = 'jwage', password = 'changeme', groups = 'json:[1, 2, 3]'
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$set] => Array
(
[username] => jwage
[password] => changeme
[groups] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
update Documents\User set password = 'changeme' where username = 'jwage'
Array
(
[className] => Documents\User
[type] => 3
[where] => Array
(
[username] => jwage
)
[newObj] => Array
(
[$set] => Array
(
[password] => changeme
)
)
[hydrate] => 1
)
update Documents\User inc count = 1, views = 2 set username = 'jwage'
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$inc] => Array
(
[count] => 1
[views] => 2
)
[$set] => Array
(
[username] => jwage
)
)
[hydrate] => 1
)
update Documents\User unset somefield, anotherfield
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$unset] => Array
(
[somefield] => 1
[anotherfield] => 1
)
)
[hydrate] => 1
)
update Documents\User push groups = :group
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$push] => Array
(
[groups] => 1
)
)
[hydrate] => 1
)
update Documents\User pushAll groups = :groups
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$pushAll] => Array
(
[groups] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
update Documents\User pull groups = :groups
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$pull] => Array
(
[groups] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
update Documents\User pullAll groups = :groups
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$pullAll] => Array
(
[groups] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
update Documents\User popFirst groups, comments
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$pop] => Array
(
[groups] => 1
[comments] => 1
)
)
[hydrate] => 1
)
update Documents\User popFirst groups popLast comments
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$pop] => Array
(
[groups] => 1
[comments] => -1
)
)
[hydrate] => 1
)
update Documents\User addToSet groups = :group
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$addToSet] => Array
(
[groups] => 1
)
)
[hydrate] => 1
)
update Documents\User addManyToSet groups = :groups
Array
(
[className] => Documents\User
[type] => 3
[newObj] => Array
(
[$addToSet] => Array
(
[groups] => Array
(
[$each] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
)
[hydrate] => 1
)
find all Documents\User
Array
(
[className] => Documents\User
[type] => 1
[hydrate] => 1
)
find all Documents\User where username = 'jwage' and password = 'changeme'
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => jwage
[password] => changeme
)
[hydrate] => 1
)
find all Documents\User
Array
(
[className] => Documents\User
[type] => 1
[hydrate] => 1
)
find username Documents\User where count > 1
Array
(
[className] => Documents\User
[type] => 1
[select] => Array
(
[0] => username
)
[where] => Array
(
[count] => Array
(
[$gt] => 1
)
)
[hydrate] => 1
)
find username Documents\User where count >= 1
Array
(
[className] => Documents\User
[type] => 1
[select] => Array
(
[0] => username
)
[where] => Array
(
[count] => Array
(
[$gte] => 1
)
)
[hydrate] => 1
)
find username Documents\User where count < 1
Array
(
[className] => Documents\User
[type] => 1
[select] => Array
(
[0] => username
)
[where] => Array
(
[count] => Array
(
[$lt] => 1
)
)
[hydrate] => 1
)
find username Documents\User where count <= 1
Array
(
[className] => Documents\User
[type] => 1
[select] => Array
(
[0] => username
)
[where] => Array
(
[count] => Array
(
[$lte] => 1
)
)
[hydrate] => 1
)
find username, password Documents\User
Array
(
[className] => Documents\User
[type] => 1
[select] => Array
(
[0] => username
[1] => password
)
[hydrate] => 1
)
find all Documents\User
Array
(
[className] => Documents\User
[type] => 1
[hydrate] => 1
)
find all Documents\User where username = 'jwage' AND password = 'changeme' AND isActive = true AND isNew = false
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => jwage
[password] => changeme
[isActive] => 1
[isNew] =>
)
[hydrate] => 1
)
find all Documents\User where groups in 'json:[1, 2, 3]'
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$in] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
find all Documents\User where groups in :groups
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$in] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
find all Documents\User where groups notIn :groups
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$nin] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
find all Documents\User where groups all :groups
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$all] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
)
[hydrate] => 1
)
find all Documents\User where groups size 3
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$size] => 3
)
)
[hydrate] => 1
)
find all Documents\User where groups exists true and comments exists false
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[groups] => Array
(
[$exists] => 1
)
[comments] => Array
(
[$exists] =>
)
)
[hydrate] => 1
)
find all Documents\User where username type string
Array
(
[className] => Documents\User
[type] => 1
[where] => Array
(
[username] => Array
(
[$type] => 2
)
)
[hydrate] => 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment