When installing Parse Server with PostgreSQL 10, adding Config entries to ParseDashboard will result in deletion of the old Config entries, i.e. Config can only put one entry. After checking the database, it is found that each new Config entry objectId is 1.
Before adding new entries:

then add new one:

add success and refresh page:

the db record:

There was originally a configuration item,after adding an entry, there should be two configuration items.
In fact, only new configuration items are added after the old ones are replaced.
Server
Database
Do you want to try a pull request to address this?
I should have free time this weekend. I鈥檓 still using PG 9.5.
It might be an issue with how JSON objects are handled in 10
Do you want to try a pull request to address this?
I should have free time this weekend. I鈥檓 still using PG 9.5.
It might be an issue with how JSON objects are handled in 10
All right, I'll try it then.
@dovewi I tried this on both PG 9.6 and PG 10. And I was able to reproduce what you were getting.
https://github.com/parse-community/parse-server/pull/2984 Originally objects were merged (most likely to support dot notation).
https://github.com/parse-community/parse-server/issues/4808 Overrides the object
I was planning on fixing something like this for https://github.com/parse-community/Parse-SDK-JS/issues/680
{ 'params.file': { __type: 'File', name: 'name', url: 'http://url' } }
{ 'params.newConfig': 'good' }
its basically like config.set('params.file') and config.set('params.newConfig');
@flovilmart What do you think?
This test fails
fit('can add new config to existing config', async () => {
await request({
method: 'PUT',
url: 'http://localhost:8378/1/config',
json: true,
body: {
params: { file: [{ __type: 'File', name: 'name', url: 'http://url' }] },
},
headers,
});
await request({
method: 'PUT',
url: 'http://localhost:8378/1/config',
json: true,
body: {
params: { newConfig: 'good' },
},
headers,
});
const result = await Parse.Config.get();
console.log(result.get('file')); // returns undefined should be [{ __type: "File" ...}]
console.log(result.get('newConfig')); // returns 'good'
});
Example object
"params": {
"newConfig": "good",
"file": [
{
"__type": "File", "name": "name", "url": "http://url"
}
]
}