appscot / sails-orientdb

OrientDB adapter for Waterline / Sails.js ORM
MIT License
25 stars 23 forks source link

Fetch array of ids like collection #155

Closed nomi-ramzan closed 8 years ago

nomi-ramzan commented 8 years ago

Hi I am trying to fetch an array of ids like linkList or linkSet basically i have this model clientIds:{ type:'array' } I am saving record ids(@rid) in it. Is there any way to fetch these records ? like model.find().populate('clientid') Or something like this model.find().explore|visit('clientid')

Thank you

dmarcelino commented 8 years ago

Hi @nomi-ramzan, you won't be able to do it in a single query. You'll need to pull the array with the rids first and then fetch the records that match the rids. Alternatively you can use the query() method and use a SQL query or try to achieve this using the orientjs via the native() method.

In order to use populate() you'll need to use Associations. More about this in the readme.

nomi-ramzan commented 8 years ago

Can you please help me in orient query ?