pg-hstore中文文档|pg-hstore js中文教程|解析

npm npmdoc 3年前 (2021-10-30) 513次浏览

pg-hstore中文文档|pg-hstore js中文教程|解析

安装命令:npm i pg-hstore

构建状态

pg-hstore

用于将 JSON 数据序列化和反序列化为 hstore 格式的节点包

安装 pg-hstore

$ npm install pg-hstore

用法

字符串化

var hstore = require('pg-hstore')();
var source = { foo: "oof", bar: "rab", baz: "zab" };
hstore.stringify(source, function(result) {
  ...
  // result = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"'
  ...
});

解析

var hstore = require('pg-hstore')();
var source = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"';
hstore.parse(source, function(result) {
  ...
  // result = { foo: "oof", bar: "rab", baz: "zab" } 
  ...
});
项目贡献人员列表:


极客公园 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:pg-hstore中文文档|pg-hstore js中文教程|解析
喜欢 (0)
.excerpt .focus {display:none}