Question: Can any body have idea how to set database connection in a propper way,

I could do this in application.properties like this:

```
spring.data.mongodb.uri=mongodb://USER:PASSWORD@ds047955.mylab.com:47955/myapp

```

But I'm sure that user name and password (USER:PASSWORD) shouldn't be here! Can any one tell me how to configure spring.data.mongodb.uri in propper PRODUCTION way?

Answer: 
I would prefer to use the JSON\_REMOVE function (MySQL) :

```
UPDATE emp
SET emp.col = JSON_REMOVE(emp.col, '$.field1');

```

You can also add a WHERE clause :

```
WHERE emp.col LIKE '%val6%';

```

*References:* [MySQL JSON\_REMOVE](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-remove) and [MySQL JSON path](https://dev.mysql.com/doc/refman/5.7/en/json-path-syntax.html)

*A blog post with examples:* [MySQL for your JSON](https://www.compose.com/articles/mysql-for-your-json/)

*And a note about json path in MySQL:* 

> 
> Propery names in path must be double quoted if the property identifier contains interpunction (spaces, special characters, meta characters) [bugs.mysql.com](https://bugs.mysql.com/bug.php?id=79051)
> 
> 
>
You can do it like this:

```
SELECT SUBSTRING(Field, 1, INSTR(Field, '"field1"')) + SUBSTRING(Field, INSTR(Field, '"field2"'), LENGTH(Field)) FROM @Temp

```

I don't know if this works but this is the idea. (Can't test ATM)

Here is the MsSQL equivalent (works, just tested!):

```
SELECT SUBSTRING(Field, 0, CHARINDEX('"field1"', Field)) + SUBSTRING(Field, CHARINDEX('"field2"', Field), LEN(Field)) FROM @Temp

```