标签:any amp code pre mongo user mail col mon
$collection = (new MongoDB\Client)->test->users;
// 增加一条
$insertOneResult = $collection->insertOne([
'username' => 'admin',
'email' => 'admin@example.com',
'name' => 'Admin User',
]);
// 增加多条
$insertManyResult = $collection->insertMany([
[
'username' => 'admin',
'email' => 'admin@example.com',
'name' => 'Admin User',
],
[
'username' => 'test',
'email' => 'test@example.com',
'name' => 'Test User',
],
]);
标签:any amp code pre mongo user mail col mon
原文地址:https://www.cnblogs.com/peilanluo/p/10503161.html