node.js - Confusing object from findById operation -


i don't know if javascript syntax error or bad use of loopback. when execute filter model , print (company object)

company.findbyid(companyid, {   include: 'markers' }, function(err, company) {  console.log(company); }); 

the console shows me output (it's good)

{ id: '85', name: 'myname', ruc: '45453453232', logo: 'https://res.cloudinary.com/dphutkz4b/image/', location: 'bolivia', imagead: 'http://res.cloudinary.com/dphutkz4b/image/upload/', markers:  [ { id: '104',      valuelk: 666,      position: '-12.101419,-77.033414',      city: 'glasgow',      district: 'ate',      banner: 'http://res.cloudinary.com/dphutkz4b/image/',      companyid: '85' } ] } 

but when print property markers object instead of console.log(company);

console.log(company.markers); 

the output whole function , cause problem when want use in .jade file

function (condorrefresh, cb) {     if (arguments.length === 0) {       if (typeof f.value === 'function') {         return f.value(self);       } else if (self.__cachedrelations) {         return self.__cachedrelations[name];       }     } else {       // check if there through model       // see https://github.com/strongloop/loopback/issues/1076       if (f._scope.collect &&         condorrefresh !== null && typeof condorrefresh === 'object') {         // adjust include condition applied         // target model         f._scope.include = {           relation: f._scope.collect,           scope: condorrefresh         };         condorrefresh = {};       }       if (arguments.length === 1) {         return definition.related(self, f._scope, condorrefresh);       } else {         return definition.related(self, f._scope, condorrefresh, cb);       }     }   } 


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -