Hi, I am running into a bit of an issue when using the default function. I'm not sure exactly how to explain this, so I'll try my best.
Code:
const mongoose = require("mongoose");
const Flake = require("flakeid");
const flake = new Flake();
const UserSchema = mongoose.Schema({
module.exports = mongoose.model("users", UserSchema);
The first time I create a document and save it, it works without errors. Any attempt after the first will result in a duplicate key error (this will reset after I restart my code). It almost seems as if the data beign returned by the function is being "cached", and when the function is called a second time it just inserts the "cached" value in.