[DOCS-14825] Add a simpler example of multikey unique constraints Created: 28/Sep/21  Updated: 13/Nov/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.2.0, 4.6 Targeted, 5.0.0, 5.1.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Improvement Priority: Minor - P4
Reporter: Nic Cottrell Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-11702

 Description   

At https://docs.mongodb.com/manual/core/index-multikey/#unique-multikey-index:

db.a.createIndex({myArray: 1}, {unique:true})
db.a.insertOne({myArray: ['a', 'b'])
db.a.insertOne({myArray: ['b', 'c']) // this will fail because another doc has 'b' already



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 08:11:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.