Node.js-Node.js,无浏览器,枪0.8.8
我创建一个对象
const body = {
a: {
must: [
{ name: 'first', size: 1 }
]
}
};
gun.get('watcher/f0de26c0-a29f-11e7-8661-154b982951a4').put(body);
接收错误
Invalid value at 'a.must'!
服务器
const Hapi = require('hapi');
const Gun = require('gun');
const server = new Hapi.Server;
server.connection({ port: 8080 });
server.connections.forEach(c => Gun({ web: c.listener, file: 'data.json' }));
server.start();
枪不跟踪阵列。您有多种表示数组的选项,具体取决于您是要跟踪元素本身还是整个数组。
1) 创建一个行为有点像数组的对象
{
0: 1,
1: 134,
2: "abc"
}
2)将数组字符串化并存储作为属性
{ val : '[1,134,"abc"]' }
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句