mirror of https://gitee.com/bigwinds/arangodb
Updated AQB.
This commit is contained in:
parent
cf17693356
commit
c34ff6130b
|
@ -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 an *ArangoCollection*, its *name* property will be used instead.
|
||||
|
||||
If the value is already an AQL Simple Reference, its value is wrapped instead.
|
||||
|
||||
*Examples*
|
||||
|
@ -118,6 +120,13 @@ Invalid values:
|
|||
* `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
|
||||
|
||||
#### Range
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "aqb",
|
||||
"license": "APACHE2_0",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"description": "ArangoDB AQL query builder.",
|
||||
"keywords": [
|
||||
"arangodb",
|
||||
|
@ -31,11 +31,11 @@
|
|||
"url": "git://github.com/arangodb/aqbjs.git"
|
||||
},
|
||||
"main": "index.js",
|
||||
"gitHead": "da036ea91d1148021686be9db77c87fbc87f807d",
|
||||
"gitHead": "71e4855a5ddd8d4800c2fd85dc75f0c8c3d3e967",
|
||||
"homepage": "https://github.com/arangodb/aqbjs",
|
||||
"_id": "aqb@1.2.0",
|
||||
"_shasum": "79e6873cf802b15b43d9bcc4e9091d3a2c42ee59",
|
||||
"_from": "aqb@1.2.0",
|
||||
"_id": "aqb@1.3.0",
|
||||
"_shasum": "948129b0a52046d6e3853c9e2d106b625f6a07a6",
|
||||
"_from": "aqb@1.3.0",
|
||||
"_npmVersion": "1.4.24",
|
||||
"_npmUser": {
|
||||
"name": "pluma",
|
||||
|
@ -48,9 +48,9 @@
|
|||
}
|
||||
],
|
||||
"dist": {
|
||||
"shasum": "79e6873cf802b15b43d9bcc4e9091d3a2c42ee59",
|
||||
"tarball": "http://registry.npmjs.org/aqb/-/aqb-1.2.0.tgz"
|
||||
"shasum": "948129b0a52046d6e3853c9e2d106b625f6a07a6",
|
||||
"tarball": "http://registry.npmjs.org/aqb/-/aqb-1.3.0.tgz"
|
||||
},
|
||||
"directories": {},
|
||||
"_resolved": "https://registry.npmjs.org/aqb/-/aqb-1.2.0.tgz"
|
||||
"_resolved": "https://registry.npmjs.org/aqb/-/aqb-1.3.0.tgz"
|
||||
}
|
||||
|
|
|
@ -49,6 +49,9 @@ function autoCastToken(token) {
|
|||
return new SimpleReference(token);
|
||||
}
|
||||
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]') {
|
||||
return new ListLiteral(token);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"aqb": "1.2.0",
|
||||
"aqb": "1.3.0",
|
||||
"buster-format": "0.5.6",
|
||||
"cheerio": "0.17.0",
|
||||
"coffee-script": "1.7.1",
|
||||
|
|
Loading…
Reference in New Issue