extract the constructor name as string
extract id as string from a mixed argument
extract id's from a mixed type
we assume that we have mongoose.models here
iterate through models and find the corresponding collection and modelname
Currently we having three different of expected Objects: Node, Relationship and Path TODO: maybe split up to submethods for each object type TODO: reduce mongodb queries by sorting ids to collection(s) and query them once per collection with $in : [ ids... ] ...
put in array to iterate
Finally called when all documents are loaded and we can pass the result to cb
[ null, {...}, null, ..., {...}, {...} ] -> [ {...}, ..., {...}, {...} ] return only path if we have a path here and the option is set to restructre TODO: find a more elegant solution than this
TODO: if distinct collection
TODO: extend Path and Relationship objects (nit possible with prototyping here)
skip if distinct collection if differ
TODO: trigger updateRelationships for both sides if query was about and option is set to
Extend out Relationship object with additional methods
do we have a distinct collection and this records is from another collection? skip if so
remove relationship from result
remove relationship from result
Define an object identifier for processPart
just push the documents to the result and leave everything else away
private dbhandler