- Loopback 4
- MongoDB v4.2.3
I'm teaching myself Loopback 4 and I have a problem in handling id. Even though I have my model id type set to string it reports it's of type number in /explorer. My goal is to use mongodb generated ids but this is blocking my progress.
My model:
import {Entity, model, property} from '@loopback/repository';
@model({
settings: {
strictObjectIDCoercion: true,
},
})
export class SearchInputs extends Entity {
@property({
type: 'string',
id: true,
})
id?: string;
...
In explorer I can fetch all the documents in the database but I can not fetch any document by id
I've read all the documentation and various tutorials and this is never mentioned. Does any one know why I have this problem?