peewee Documentation
Release 3.5.0update() method: >>> KV.update(value=KV.value.update({'k1': 'v1-x', 'k2': 'v2'})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1-x', 'k2': 'v2'} We can also set individual parts of the JSON data using get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2'} The set() method can also be used with objects, in addition to scalar values: >>> KV.update(value=KV.value['k2'].set({'x2': 'y2'})).execute() 1 >>> KV value {'k1': 'v1', 'k2': {'x2': 'y2'}} Parameters: Returns: Individual parts of the JSON data can be removed atomically as well, using remove(): >>> KV.update(value=KV.value['k2'].remove()).execute()0 码力 | 347 页 | 380.80 KB | 1 年前3
 peewee Documentation
Release 3.5.0update() method: >>> KV.update(value=KV.value.update({'k1': 'v1-x', 'k2': 'v2'})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1-x', 'k2': 'v2'} We can also set individual parts of the JSON data using get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2'} The set() method can also be used with objects, in addition to scalar values: >>> KV.update(value=KV.value['k2'].set({'x2': 'y2'})).execute() 1 (continues key == 'a').value {'k1': 'v1', 'k2': {'x2': 'y2'}} Individual parts of the JSON data can be removed atomically as well, using remove(): >>> KV.update(value=KV.value['k2'].remove()).execute() 1 >>> KV0 码力 | 282 页 | 1.02 MB | 1 年前3
 peewee Documentation Release 3.6.0“k1=v1” is preserved: >>> KV.update(value=KV.value.update({'k2': 'v2', 'k3': 'v3'})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'} We can also update existing data atomically “k1” and remove “k3” (“k2” will not be modified): >>> KV.update(value=KV.value.update({'k1': 'v1-x', 'k3': None})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1-x', 'k2': 'v2'} We can also set get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2'} The set() method can also be used with objects, in addition to scalar values: >>> KV.update(value=KV.value['k2'].set({'x2': 'y2'})).execute() 1 >>> KV0 码力 | 377 页 | 399.12 KB | 1 年前3
 peewee Documentation
Release 3.6.0“k1=v1” is preserved: >>> KV.update(value=KV.value.update({'k2': 'v2', 'k3': 'v3'})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'} We can also update existing data atomically “k1” and remove “k3” (“k2” will not be modified): >>> KV.update(value=KV.value.update({'k1': 'v1-x', 'k3': None})).execute() 1 >>> KV.get(KV.key == 'a').value {'k1': 'v1-x', 'k2': 'v2'} We can also set get(KV.key == 'a').value {'k1': 'v1', 'k2': 'v2'} The set() method can also be used with objects, in addition to scalar values: >>> KV.update(value=KV.value['k2'].set({'x2': 'y2'})).execute() 1 >>> KV0 码力 | 302 页 | 1.02 MB | 1 年前3
 peewee Documentation Release 3.4.0('Post 3', []) insert(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping execute()) replace(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping .execute()) set(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping0 码力 | 349 页 | 382.34 KB | 1 年前3
 peewee Documentation
Release 3.3.0insert(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping replace(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping set(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping0 码力 | 280 页 | 1.02 MB | 1 年前3
 peewee Documentation
Release 3.4.0insert(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping replace(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping set(*pairs, **data) Parameters • pairs – A flat list consisting of key, value pairs. E.g., k1, v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. • data – keyword arguments mapping0 码力 | 284 页 | 1.03 MB | 1 年前3
 peewee Documentation Release 3.0.0('Post 3', []) insert(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSON path. data – keyword arguments mapping paths execute()) replace(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSON path. data – keyword arguments mapping paths .execute()) set(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSON path. data – keyword arguments mapping paths0 码力 | 319 页 | 361.50 KB | 1 年前3
 peewee Documentation Release 3.1.0('Post 3', []) insert(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping execute()) replace(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping .execute()) set(*pairs, **data) pairs – A flat list consisting of key, value pairs. E.g., k1 v1, k2, v2, k3, v3. The key may be a simple string or a JSONPath instance. data – keyword arguments mapping0 码力 | 332 页 | 370.77 KB | 1 年前3
共 9 条
- 1
 













