Open
Description
Given any model wich I want to scope by two reference_fields ['fieldA','fieldB'] this would give an error of mongo duplicate key.
const mongoose = require('mongoose'),
Schema = mongoose.Schema;
const AutoIncrement = require('mongoose-sequence')(mongoose);
const schema = new Schema(
{
empresa: { type: Number, required: true },
pedido: { type: Number, required: true },
key: Number, //sequence
});
schema.plugin(AutoIncrement, { id: 'items', inc_field: 'key', reference_fields: ['empresa','pedido'] });
´``
This bug can be reproduced with the latest 4.0.1 version.
Metadata
Metadata
Assignees
Labels
No labels