I want to perfrom this query
update abc
set color= case
WHEN indexValue=0.904 THEN 'rgba(0,0,0,0.3)'
WHEN indexValue=0.908 THEN 'rgba(0,0,0,0.3)'
WHEN indexValue=0.912 THEN 'rgba(255,255,255,0.3)'
WHEN indexValue >= 0.6 THEN 'rgba(0,80,0,0.6)'
WHEN indexValue >= -0.05 and indexValue<0 THEN 'rgba(128,128,128,0.6)'
END;
But I'm not able to find any solution for this in mongoDB query. I know this query of mongoDB:
db.abc.update( { $and: [ { indexValue: { $gte: 0.2 } }, { indexValue: { $lt:0.25 } } ] },
{$set : {"color":"rgba(255,225,0,0.6)"}},
{upsert:false, multi:true})
Can anybody help me out in this?