I suspect BSONArray
is immutable and the add
operation is returning a new array.
Try:
var parameters = BSONArray()
parameters = parameters add BSONDocument("$limit" -> limit)
سؤال
I have initiated an empty BSONArray
an the used the add
function to add some BSONDocument
s but BSONArray stays empty
Here is some sample code
var parameters = BSONArray()
parameters add BSONDocument("$limit" -> limit)
The limit document is just not added...
المحلول
I suspect BSONArray
is immutable and the add
operation is returning a new array.
Try:
var parameters = BSONArray()
parameters = parameters add BSONDocument("$limit" -> limit)