-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Schema Validation
-
None
-
Not Needed
Hello,
im trying to insert a document containing some int, string and an array.
I have a validation schema :like this
numbers:
{ bsonType: [ 'int' ], description: '' },
data: {
bsonType: [
'array'
],
minItems: 1,
uniqueItems: true,
additionalProperties: false,
items: {
bsonType: [
'object'
],
required: [
'idData',
'dataName'
],
additionalProperties: false,
properties: {
idData:
,
dataName:
}
}
}
If i try to insert a document containing int and array it fails validation,
if i insert the same document , but change the bsontype of numbers from 'int' to 'double'
the validation goes ok and the document is inserted.
Can u help pls?
this is the document i try to insert :
{ { "numbers": 2, "data": [
{ "idData":new ObjectId(), "dataName": "name" } ]
}