Hi,
One thing came in mind that if we have a collection and in that collection i have multiple documents and there is a field named customerId
for example which is null
and i want to add something in customerId
field. i.e.
/1/
{
“userId” : “u12”
“customerId” : null
“province” : “KPK”
}
/2/
{
“userId” : “u13”
“customerId” : null
“province” : “KPK”
}
/3/
{
“userId” : “u14”
“customerId” : null
“province” : “PUNJAB”
}
And i want to replace all the null with a value, for that i can use $ifNull
operator but it will work for online one document at a time(i think) . I want to know that is there is a possibility in MmongoDB to add data in incremental form i.e.
/1/
{
“userId” : “u12”
“customerId” : “c101”
“province” : “KPK”
}
/2/
{
“userId” : “u13”
“customerId” : “c102”
“province” : “KPK”
}
/3/
{
“userId” : “u14”
“customerId” : “c103”
“province” : “PUNJAB”
}