MongoDB query to capitalise first letter in existing database
问题 Here is the problem, I want to capitalise the first letter of a name in my existing database, just wanted to know if there is any query so that i can make it possbile. what i want -- in my database so many names is in unformatted ways.. like lucy, Sean, jon and so on. i want to make them in a formatted ways like. Lucy. Sean, Jon. Can anyone help me with this? Thanks in advance. 回答1: it may not be the best solution. the only hiccup in below suggestion is to get "3" of $substr:["$name1",1, 3 ]