We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$result = $this->db->collection('xxx')->updateOne(['_id'=> ‘xxxxx’], ['$set'=> ['fd'=> 'xxxx']]);
这样做,更新不成功,麻烦告诉下,谢谢 Hyperf\GoTask\MongoClient\Type\UpdateResult Object ( [matchedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0 [modifiedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0 [upsertedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0 [upsertedId:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => ) 这个是打印的$result返回值 确定updateOne里面的数据是无误的 我试过用其他字段修改是成功的,但是改用 _id 之后就不行了
The text was updated successfully, but these errors were encountered:
$mongoId = '5a2493c33c95a1281836eb6a'; $collection->find(['_id'=> new MongoDB\BSON\ObjectId("$mongoId")]);
_Id 没有映射为字符串,而是映射为MongoDB\BSON\ObjectId 对象。
Sorry, something went wrong.
$mongoId = '5a2493c33c95a1281836eb6a'; $collection->find(['_id'=> new MongoDB\BSON\ObjectId("$mongoId")]); _Id 没有映射为字符串,而是映射为MongoDB\BSON\ObjectId 对象。
谢谢,按你说的,已解决
No branches or pull requests
$result = $this->db->collection('xxx')->updateOne(['_id'=> ‘xxxxx’], ['$set'=> ['fd'=> 'xxxx']]);
这样做,更新不成功,麻烦告诉下,谢谢
Hyperf\GoTask\MongoClient\Type\UpdateResult Object
(
[matchedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0
[modifiedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0
[upsertedCount:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] => 0
[upsertedId:Hyperf\GoTask\MongoClient\Type\UpdateResult:private] =>
)
这个是打印的$result返回值
确定updateOne里面的数据是无误的
我试过用其他字段修改是成功的,但是改用 _id 之后就不行了
The text was updated successfully, but these errors were encountered: