Description
Describe the bug
Environment
- Any OS
- Any architecture
- PostgreSQL 17.5
- DocumentDB 0.103
Reproduction Steps
test> db.coll.insertOne({v: 'x'.repeat(1939)});
{
acknowledged: true,
insertedId: ObjectId('6820a9109c3f60538a3b9274')
}
test> db.coll.findOneAndDelete({})
{ n: 1 }
test> db.coll2.insertOne({v: 'x'.repeat(1938)});
{
acknowledged: true,
insertedId: ObjectId('6820a92c9c3f60538a3b9275')
}
test> db.coll2.findOneAndDelete({})
{
_id: ObjectId('6820a92c9c3f60538a3b9275'),
v: 'xxx […] xxx'
}
Expected behavior
documentdb_api.find_and_modify
returns data in both cases.
Actual behavior
When data is too large, this function does not return the data.
Additional context
See the FerretDB user bug report at FerretDB/FerretDB#5145 and our test script at FerretDB/FerretDB#5148.