Question: Why AbstractClass._forDB stringify JSON and Array.
- Langage dominant
- JavaScript
- Étoiles
- 2k
- Forks
- 238
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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;
};
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, mongodb, mysql, node.js, postgresql, redis, sqlite
- Domaine
- backend-api-design, database
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100