1
0
Fork 0

Updated AQB.

This commit is contained in:
Alan Plum 2014-09-14 16:38:55 +02:00
parent cf17693356
commit c34ff6130b
4 changed files with 21 additions and 9 deletions

9
js/node/node_modules/aqb/README.md generated vendored
View File

@ -97,6 +97,8 @@ Wraps a given value in an AQL Simple Reference.
If the value is not a JavaScript string or not a well-formed simple reference, an *AQLError* will be thrown. If the value is not a JavaScript string or not a well-formed simple reference, an *AQLError* will be thrown.
If the value is an *ArangoCollection*, its *name* property will be used instead.
If the value is already an AQL Simple Reference, its value is wrapped instead. If the value is already an AQL Simple Reference, its value is wrapped instead.
*Examples* *Examples*
@ -118,6 +120,13 @@ Invalid values:
* `foo-bar` * `foo-bar`
* `foo[bar]` * `foo[bar]`
ArangoDB collection objects can be passed directly:
```js
var myUserCollection = applicationContext.collection('users');
var users = db._query(qb.for('u').in(myUserCollection).return('u')).toArray();
```
### AQL Expressions ### AQL Expressions
#### Range #### Range

View File

@ -1,7 +1,7 @@
{ {
"name": "aqb", "name": "aqb",
"license": "APACHE2_0", "license": "APACHE2_0",
"version": "1.2.0", "version": "1.3.0",
"description": "ArangoDB AQL query builder.", "description": "ArangoDB AQL query builder.",
"keywords": [ "keywords": [
"arangodb", "arangodb",
@ -31,11 +31,11 @@
"url": "git://github.com/arangodb/aqbjs.git" "url": "git://github.com/arangodb/aqbjs.git"
}, },
"main": "index.js", "main": "index.js",
"gitHead": "da036ea91d1148021686be9db77c87fbc87f807d", "gitHead": "71e4855a5ddd8d4800c2fd85dc75f0c8c3d3e967",
"homepage": "https://github.com/arangodb/aqbjs", "homepage": "https://github.com/arangodb/aqbjs",
"_id": "aqb@1.2.0", "_id": "aqb@1.3.0",
"_shasum": "79e6873cf802b15b43d9bcc4e9091d3a2c42ee59", "_shasum": "948129b0a52046d6e3853c9e2d106b625f6a07a6",
"_from": "aqb@1.2.0", "_from": "aqb@1.3.0",
"_npmVersion": "1.4.24", "_npmVersion": "1.4.24",
"_npmUser": { "_npmUser": {
"name": "pluma", "name": "pluma",
@ -48,9 +48,9 @@
} }
], ],
"dist": { "dist": {
"shasum": "79e6873cf802b15b43d9bcc4e9091d3a2c42ee59", "shasum": "948129b0a52046d6e3853c9e2d106b625f6a07a6",
"tarball": "http://registry.npmjs.org/aqb/-/aqb-1.2.0.tgz" "tarball": "http://registry.npmjs.org/aqb/-/aqb-1.3.0.tgz"
}, },
"directories": {}, "directories": {},
"_resolved": "https://registry.npmjs.org/aqb/-/aqb-1.2.0.tgz" "_resolved": "https://registry.npmjs.org/aqb/-/aqb-1.3.0.tgz"
} }

3
js/node/node_modules/aqb/types.js generated vendored
View File

@ -49,6 +49,9 @@ function autoCastToken(token) {
return new SimpleReference(token); return new SimpleReference(token);
} }
if (typeof token === 'object') { if (typeof token === 'object') {
if (Object.prototype.toStrint.call(token) === '[object ArangoCollection]') {
return new Identifier(token.name);
}
if (Object.prototype.toString.call(token) === '[object Array]') { if (Object.prototype.toString.call(token) === '[object Array]') {
return new ListLiteral(token); return new ListLiteral(token);
} }

View File

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"aqb": "1.2.0", "aqb": "1.3.0",
"buster-format": "0.5.6", "buster-format": "0.5.6",
"cheerio": "0.17.0", "cheerio": "0.17.0",
"coffee-script": "1.7.1", "coffee-script": "1.7.1",