{"repo":"cdimascio/uuid-mongodb","free":true,"listed":false,"github":"https://github.com/cdimascio/uuid-mongodb","clone":"git clone https://github.com/cdimascio/uuid-mongodb.git","description":"📇 Generates and parses MongoDB BSON UUIDs","language":"JavaScript","stars":102,"topics":["uuid","mongodb","nodejs","bson","mongoose","mongo","binary","hacktoberfest"],"license":"MIT","category":"data-pipelines","readme_excerpt":"uuid-mongodb Generates and parses BSON UUIDs for use with MongoDB. BSON UUIDs provide better performance than their string counterparts. Inspired by @srcagency's mongo-uuid Install Usage Formatting UUIDs may be formatted using the following options: Format Description Example -- -- -- N 32 digits 00000000000000000000000000000000 D 32 digits separated by hyphens 00000000-0000-0000-0000-000000000000 B 32 digits separated by hyphens, enclosed in braces {00000000-0000-0000-0000-000000000000} P 32 digits separated by hyphens, enclosed in parentheses (00000000-0000-0000-0000-000000000000) example: Modes uuid-mongodb offers two modes: - canonical (default) - A string format that emphasizes type preservation at the expense of readability and interoperability. - relaxed - A string format that emphasizes readability and interoperability at the expense of type preservation. The mode is set globally as such: Mode only impacts how JSON.stringify(...) represents a UUID: e.g. JSON.stringy(mUUID.v1()) outputs the following: Examples Query using binary UUIDs Work with binary UUIDs returned in query results Examples (with source code) Native Node MongoDB Driver example - examples/ex1-mongodb.js snippet: Mongoose example - examples/ex2-mongoose.js snippet: - examples/ex3-mongoose.js snippet: - examples/ex4-mongoose.js Notes Currently supports UUID v1 and v4 Contributors Thanks goes to these wonderful people (emoji key): Carmine DiMascio 💻 Benjamin Dobell 💻 David Pfeffer 💻 This project follow","default_branch":null,"files":null,"tree":[],"storefront":"/r/cdimascio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cdimascio/uuid-mongodb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}