Book Example

Indexes Index Introduction Index Concepts Indexing Tutorials Indexing Reference

替换 文字

var cursor = db.test.find();
while (cursor.hasNext()) {
  var x = cursor.next();
  print("Before: "+x['item']);
  x['item'] = x['item'].replace('红包', '外快');
  print("After: "+x['item']);
  db.test.update({_id : x._id}, x);
}

results matching ""

    No results matching ""