diff --git a/queries.md b/queries.md index 6b4389c9c77..3f96d218a83 100644 --- a/queries.md +++ b/queries.md @@ -812,13 +812,15 @@ You may insert several records at once by passing an array of arrays. Each array ['email' => 'janeway@example.com', 'votes' => 0], ]); -The `insertOrIgnore` method will ignore duplicate record errors while inserting records into the database: +The `insertOrIgnore` method will ignore errors while inserting records into the database: DB::table('users')->insertOrIgnore([ ['id' => 1, 'email' => 'sisko@example.com'], ['id' => 2, 'email' => 'archer@example.com'], ]); +> {note} `insertOrIgnore` will ignore duplicate records and also may ignore other types of errors depending on the database engine. For example, `insertOrIgnore` will [bypass MySQL's strict mode](https://dev.mysql.com/doc/refman/en/sql-mode.html#ignore-effect-on-execution). + #### Auto-Incrementing IDs