{"action":"created","issue":{"url":"https://api.github.com/repos/codemix/oriento/issues/188","labels_url":"https://api.github.com/repos/codemix/oriento/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/codemix/oriento/issues/188/comments","events_url":"https://api.github.com/repos/codemix/oriento/issues/188/events","html_url":"https://github.com/codemix/oriento/issues/188","id":53882518,"number":188,"title":"Sub-query + $parent.$current","user":{"login":"MarcelPitch","id":7402969,"avatar_url":"https://avatars.githubusercontent.com/u/7402969?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcelPitch","html_url":"https://github.com/MarcelPitch","followers_url":"https://api.github.com/users/MarcelPitch/followers","following_url":"https://api.github.com/users/MarcelPitch/following{/other_user}","gists_url":"https://api.github.com/users/MarcelPitch/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcelPitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcelPitch/subscriptions","organizations_url":"https://api.github.com/users/MarcelPitch/orgs","repos_url":"https://api.github.com/users/MarcelPitch/repos","events_url":"https://api.github.com/users/MarcelPitch/events{/privacy}","received_events_url":"https://api.github.com/users/MarcelPitch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-09T15:59:59Z","updated_at":"2015-01-12T10:50:33Z","closed_at":"2015-01-11T23:14:02Z","body":"Hi @phpnode,\r\n\r\nHappy new year !!! :tada:\r\n\r\nI'm working with **orientDB 2.0-RC1** and **oriento 0.7.0**.\r\n\r\nAnd for celebrating this new year, I've a problem (:smile:) with the use of `$parent.$current`in a sub-query.\r\n\r\nHere's a little test :\r\n\r\n```js\r\ndescribe(\"Test sub-query + $parent.$current\", function () {\r\n\r\n    before(function () {\r\n        return CREATE_TEST_DB(this, 'subquery_parent_current_db')\r\n            .bind(this)\r\n            .then(function () {\r\n                return this.db.class.create('VertexOne','V');\r\n            })\r\n            .then(function (vOneClass) {\r\n                return vOneClass.property.create({\r\n                    name: 'uuid',\r\n                    type: 'Integer'\r\n                });\r\n            })\r\n            .then(function () {\r\n                return this.db.class.create('VertexTwo','V');\r\n            })\r\n            .then(function (vTwoClass) {\r\n                return vTwoClass.property.create({\r\n                    name: 'uuid',\r\n                    type: 'Integer'\r\n                });\r\n            })\r\n            .then(function () {\r\n                return this.db.class.create('HAS_EDGE','E');\r\n            })\r\n            .then(function () {\r\n                return this.db.vertex.create({\r\n                    '@class': 'VertexOne',\r\n                    uuid: 1\r\n                })\r\n            })\r\n            .then(function () {\r\n                return this.db.vertex.create({\r\n                    '@class': 'VertexTwo',\r\n                    uuid: 2\r\n                })\r\n            })\r\n            .then(function () {\r\n                return this.db.vertex.create({\r\n                    '@class': 'VertexTwo',\r\n                    uuid: 3\r\n                })\r\n            })\r\n            .then(function () {\r\n                return this.db.edge.from(\"SELECT FROM VertexOne WHERE uuid = 1\").to(\"SELECT FROM VertexTwo WHERE uuid = 2\").create('HAS_EDGE');\r\n            })\r\n            .then(function () {\r\n                return this.db.edge.from(\"SELECT FROM VertexOne WHERE uuid = 1\").to(\"SELECT FROM VertexTwo WHERE uuid = 3\").create('HAS_EDGE');\r\n            });\r\n    });\r\n    after(function () {\r\n        return DELETE_TEST_DB('subquery_parent_current_db');\r\n    });\r\n\r\n    it(\"should test if request return a value\", function () {\r\n        return this.db.exec(\"SELECT $VTwo FROM VertexOne LET $VTwo = (SELECT uuid FROM (SELECT expand(out('HAS_EDGE')) FROM $parent.$current)) WHERE uuid = 1\")\r\n            .then(function (result) {\r\n                result.results[0].content.forEach(function(item){\r\n                    item.value.Rid1.should.be.eql(item.value.Rid2[0]);\r\n                })\r\n            })\r\n            .catch(function (err) {\r\n                throw err;\r\n            })\r\n    });\r\n});\r\n```\r\n\r\nI know there's a simpler way to write the request, but it's a part of a more complex request.\r\n\r\nI've executed the same one with *OrientDB* console and in a *Java* project using the *binary* protocol. The both return a value as well !!!\r\n\r\nLet me know if you need more information.\r\n\r\nAnd have a good week-end !!!"},"comment":{"url":"https://api.github.com/repos/codemix/oriento/issues/comments/69553707","html_url":"https://github.com/codemix/oriento/issues/188#issuecomment-69553707","issue_url":"https://api.github.com/repos/codemix/oriento/issues/188","id":69553707,"user":{"login":"MarcelPitch","id":7402969,"avatar_url":"https://avatars.githubusercontent.com/u/7402969?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcelPitch","html_url":"https://github.com/MarcelPitch","followers_url":"https://api.github.com/users/MarcelPitch/followers","following_url":"https://api.github.com/users/MarcelPitch/following{/other_user}","gists_url":"https://api.github.com/users/MarcelPitch/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcelPitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcelPitch/subscriptions","organizations_url":"https://api.github.com/users/MarcelPitch/orgs","repos_url":"https://api.github.com/users/MarcelPitch/repos","events_url":"https://api.github.com/users/MarcelPitch/events{/privacy}","received_events_url":"https://api.github.com/users/MarcelPitch/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T10:50:33Z","updated_at":"2015-01-12T10:50:33Z","body":"OK @phpnode,\r\n\r\nThanks !\r\n\r\nI'm writing a new issue on Orient DB.\r\n\r\nHave a nice day !!!"}}