Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Error when nested property isn't there #15

benatkin opened this Issue · 3 comments

2 participants


I saw that nested properties are supported in the language and in js-array. Neat! This is probably not the desired behavior when it can't go deep enough, though:

> rql.query("", {}, [{"path":[1,2,3]},{"path":[9,3,7]}])
TypeError: Cannot read property 'cat' of undefined
    at Array.<anonymous> (eval at query (/Users/ben/.node_libraries/.npm/rql/0.2.2/package/lib/js-array.js:363:53))
    at Array.<anonymous> (/Users/ben/.node_libraries/.npm/rql/0.2.2/package/lib/js-array.js:91:25)
    at Array.<anonymous> (eval at query (/Users/ben/.node_libraries/.npm/rql/0.2.2/package/lib/js-array.js:363:53))
    at eval at query (/Users/ben/.node_libraries/.npm/rql/0.2.2/package/lib/js-array.js:363:53)
    at Object.query (/Users/ben/.node_libraries/.npm/rql/0.2.2/package/lib/js-array.js:364:18)
    at [object Context]:1:5
    at Interface.<anonymous> (repl:98:19)
    at Interface.emit (events:27:15)
    at Interface._ttyWrite (readline:295:12)
    at Interface.write (readline:132:30)

Pulled the new version, and it does indeed fix this issue!

> var rql = require('rql/js-array')
> var docs = [{'html':{'head':{'title':'Hello'}}}, {'html':{'head':{'title':'Ben'}}}, {'name': 'Ben', 'age': 28}]
> rql.query('html.head.title=Hello', {}, docs)
[ { html: { head: [Object] } } ]

Have it fixed your first example?!


Yes, it did. :)

> rql.query("", {}, [{"path":[1,2,3]},{"path":[9,3,7]}])


@deanlandolt deanlandolt referenced this issue from a commit in deanlandolt/rql
@dvv dvv fix to issue #15 plus test 21eca01
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.