code: function encodeJson(path, value) {
      var objInJson = {
              bn: cutils.getNumPath(path),
              e: []
          },
          pathType = cutils.getPathDateType(path),
          pathArray = cutils.getPathArray(path),
          oid = pathArray[0];
  
      if (pathType !== 'resource' && !_.isPlainObject(value))
          throw new TypeError('value should be an object.');
  
      switch (pathType) {
          case 'object':         // obj
              _.forEach(value, function (iObj, iid) {
                  _.forEach(iObj, function (resrc, rid) {
                      if (_.isPlainObject(resrc)) {
                          _.forEach(resrc, function (r, riid) {
                              var data = encodeJsonValue(iid + '/' + cutils.ridNumber(oid, rid) + '/' + riid, r);
                              objInJson.e.push(data);
                          });
                      } else {
                          var data = encodeJsonValue(iid + '/' + cutils.ridNumber(oid, rid), resrc);
                          objInJson.e.push(data);
                      }
                  });
              });
              break;
  
          case 'instance':         // inst
              _.forEach(value, function (resrc, rid) {
                  if (_.isPlainObject(resrc)) {
                      _.forEach(resrc, function (r, riid) {
                          var data = encodeJsonValue(cutils.ridNumber(oid, rid) + '/' + riid, r);
                          objInJson.e.push(data);
                      });
                  } else {
                      var data = encodeJsonValue(cutils.ridNumber(oid, rid), resrc);
                      objInJson.e.push(data);
                  }
              });
              break;
  
          case 'resource':         // resrc
              if (_.isPlainObject(value)) {
                  _.forEach(value, function (r, riid) {
                      var data = encodeJsonValue(riid, r);
                      objInJson.e.push(data);
                  });
              } else {
                  if (value instanceof Date) value = Number(value);
                  var data = encodeJsonValue('', value);
                  objInJson.e.push(data);
              }
              break;
  
          default:
              break;
       }
  
      return  cutils.bufferFrom(JSON.stringify(objInJson));
  }
docs: *******************************************************
  Json                                                  *
  *******************************************************