1602 / 1602/jugglingdb

Question: Why AbstractClass._forDB stringify JSON and Array.

Aperta
#335 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2k
Fork
238
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, I try to use jugglingdb and can't understand for what function "AbstractClass._forDB" converts object and array to string. This limits search by criterias. We have to use regular expressions or exists another way. Thank for help.

```
AbstractClass._forDB = function (data) {
var res = {};
Object.keys(data).forEach(function (propName) {
var typeName = this.whatTypeName(propName);
if (!typeName && !data[propName] instanceof Array) {
return;
}
if (typeName === 'JSON' || data[propName] instanceof Array) {
res[propName] = JSON.stringify(data[propName]);
} else {
res[propName] = data[propName];
}
}.bind(this));
return res;
};
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Look at the AbstractClass._forDB function in the codebase, likely in a file like lib/abstract_class.js. Understand how JSON and Array data is handled for different database adapters (redis, mongodb, mysql, etc.). Check if there are existing tests for this function or related search functionality. Determine if the stringification is necessary for all adapters or if it can be conditional.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, mongodb, mysql, node.js, postgresql, redis, sqlite
Ambito
backend-api-design, database
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.