You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the memory adapter and saving json objects, like shown in the example below, the objects are converted into strings but when returned from "find" method the values are not converted back:
constcaminte=require('caminte'),Schema=caminte.Schema,config={driver : "memory",};letschema=newSchema(config.driver,config);letusers=schema.define('user ',{id: {type: schema.Integer},name: {type: schema.String},data: {type: schema.Json}},{primaryKeys: ['id']});users.create({id: 1,name: 'raffaele',data: {age: 22}},()=>{users.find({where: {}},function(err,users){console.log('users:',users);// the data object is a string});});
From what i see this depends on the fact that the memory driver is handled in the AbstractClass class as a "SQL" adapter, which means that the json values are stringified:
When using the memory adapter and saving json objects, like shown in the example below, the objects are converted into strings but when returned from "find" method the values are not converted back:
From what i see this depends on the fact that the memory driver is handled in the AbstractClass class as a "SQL" adapter, which means that the json values are stringified:
But the memory adapter doesn't then parse the values when returning them from methods like "find".
The text was updated successfully, but these errors were encountered: