【问题标题】:How to remove a member of a Gun unordered list如何删除 Gun 无序列表的成员
【发布时间】:2018-01-15 21:27:43
【问题描述】:

给定以下枪支无序列表,如何从机器列表中删除机器?

let gun = new Gun();
let machineId = 'cool-machine';
let location = {
  lat: position.coords.latitude,
  lng: position.coords.longitude
};

let machines = gun.get('machines');

let machine = gun.get('machine/' + machineId);
machine.put({machineId, location});

【问题讨论】:

    标签: gun


    【解决方案1】:

    使用枪/未设置:

    • 在节点或浏览器中包含 gun/unset。它位于 lib 文件夹中。

    machines.unset(machine);

    【讨论】:

      猜你喜欢
      • 2022-07-06
      • 1970-01-01
      • 2015-11-21
      • 1970-01-01
      • 2011-04-29
      • 1970-01-01
      • 2013-03-07
      • 1970-01-01
      • 2013-05-12
      相关资源
      最近更新 更多