When working with Typescript and the loopback-connector-mongodb library, I encountered an issue where I received the error message
Object literal may only specify known properties
.
interface Foo {
likes: number;
}
// Utilizing MongoDB's '$inc' to increment likes
async increaseLikes(id: string): Promise<void> {
await this.fooRepository.updateById(id, {"$inc": {likes: 1}})
}