Skip to content

Issue with database juggler / mongodb #1049

@cajoy

Description

@cajoy

Description/Steps to reproduce

I can retrieve all models 👍

const models = await this.repository.find()

But when I want to filter, it doesn't work. Always empty list. 👎

const venueModels = await this.repository.find({where: {foursquareId: '5952cf02829b0c59fa430f63'}})

But it works if I directly apply filter in mongodb: 👍

db.getCollection('TestFoursquare').find({ foursquareId: '5952cf02829b0c59fa430f63' })

Also one more issue when I try findOne, may be related: 👎

const model = await this.repository.findOne({where: { foursquareId: '5952cf02829b0c59fa430f63' }})
  loopback:connector:mongodb all TestFoursquare { where: { foursquareId: '5952cf02829b0c59fa430f63' },
  limit: 1,
  offset: 0,
  skip: 0 } null [] +8ms
  loopback:rest:error Unhandled error in GET /places/around: 500 TypeError: Cannot read property 'toObject' of null
    at UntappedFoursquareRepository.toEntity (/Users/alex/ProjectsAlex/droppy.shop/api.follow.beer/node_modules/@loopback/repository/dist/src/legacy-juggler-bridge.js:148:43)
    at UntappedFoursquareRepository.findOne (/Users/alex/ProjectsAlex/droppy.shop/api.follow.beer/node_modules/@loopback/repository/dist/src/legacy-juggler-bridge.js:102:21)
    at <anonymous> +0ms

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions