Assuming I have fetched a single document via
strapi.query('restaurant').findOne({ id: 1 });
What is the most elegant way to change that document and persist it?
The documentation only seems to mention the update query which queries the document again instead of just saving it:
strapi.query('restaurant').update(
{ title: 'specific name' },
{
title: 'restaurant name',
}
);
Is there a more ORM like way to save?
I expected something like:
let record = strapi.query('restaurant').findOne({ id: 1 })
record.title = 'new title'
record.save()
Is something like this possible? Or is there a reason for not providing this concept?
To access ORM add .model after .query()
let record = strapi.query('restaurant').model.findOne({ id: 1 })
record.title = 'new title'
record.save()
That was my initial approach. But I thought that this is bypassing the strapi features like lifecycle methods etc. Is that not the case?
Yes, Strapi’s lifecycles will not be triggered when you are using ORM queries.
But take a look here in the documentation:

Hmm. ok thanks.
My two cents: That is a potential source for error and unexpected behavior. Circumventing the lifecycle hooks and having to always think of triggering these manually feels very “low level”-ish… I am pretty sure that I will forget to call them here and there 
So I will stick to
strapi.query('restaurant').update({...}, {...})
for now…
Consider this a feature request:
“As a Developer I would like to query documents via strapi API (find() or findOne()) that I can alter and persist again using document.save(). This would basically be a helper method that calls the underlying mongoose .save() function AND also triggers the strapi lifecycle methods.”
BTW: Where is the best place to submit feature requests, if these are welcome?
Feature Requests by the community are highly encouraged.
Please feel free to submit a feature request or to upvote
an existing feature request in the ProductBoard.
Without using Mongoose directly, your update query should use the ID instead of the title for the update request
strapi.query('restaurant').findOne({ id: 1 });
strapi.query('restaurant').update(
{ id: 1 },
{
title: 'restaurant name',
}
);