MongoDb查询
1. 查询不为空的
{workOrder: {$ne: null}}

作者文章归档:陈海峰
pg数据库的回滚是瞬间完成的。看到这句话是不是觉得pg很先进,确实是这样,但是也是有代价的,下面聊一聊这个问题。
事务的回滚和数据库的MVCC机制是分不开的,先看看以oracle和mysql为代表的基于undo表空间实现的mvcc。
以mysql为例,mysql undo两个最重要的功能,一个是实现了写不阻塞读,或者说是mvcc,另外一个当然就是事务的回滚。
MySQL在进行数据操作时,先将数据备份到undo段中,然后再进行数据的修改,这样未提交的数据会保存一份前镜像在undo中,同时数据行上的rollpointer指针指向undo段上的老数据
主要处理
def get_Incident_view() -> HttpResponse:
status_list = [choices[0] for choices in RepairOrder.STATUS.choices if choices[0] != RepairOrder.STATUS.CHECKED_OUT]
# repair_order_part_queryset = []
# dict = {
# rop_r.repair_order : rop_r
# for rop_r in RepairOrder# example of usage grafana/loki api when you need push any log/message from your python scipt
import requests
import json
import datetime
import pytz
host = 'somehost'
curr_datetime = datetime.datetime.now(pytz.timezone('Asia/Yekaterinburg'))
curr_datetime docker-compose.yml
version: "3.0"
services:
mysql-master:
hostname: mysql-master
container_name: mysql-master
image: mysql:latest
ports:
- 3307:3306
environment:
- MYSQL_ROOT_PASSWORD=chenhaifeng
volumes:
- ./master/my.cnf:/etc/mysqlversion: '3'
services:
elasticsearch:
image: elasticsearch:7.13.4
container_name: es
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node&qapi.http
@host = 127.0.0.1
@port = 8001
@token = d2f8876850f9ddd904f8653466aa980e6433c7fe
@baseUrl = http://{{host}}:{{port}}
### 1. stock_item全部数据获取
# @name login
GET {{baseUrl}}/api/stock/get_stock_item_with_num_of_child/ HTTP/1.1
content-type: application/json
Authorization if start_date and end_date:
start_date = timezone.make_aware(datetime.strptime(start_date, "%Y/%m/%d"), timezone.get_current_timezone()).date()
end_date = timezone.make_aware(datetime.strptime(end_date, "%Y/%m/%d"), timezone.get_current_timezone()gopdf gopdf is a simple library for generating PDF document written in Go lang.
A minimum version of Go 1.13 is required.
Features Unicode subfont embedding. (Chinese, Japanese, Korean, etc.) Draw line, oval, rect, curve Draw image ( jpg, png ) Set image mask Password protection Font kerning Install
github.com/xuri/excelize/v2
func (f *File) SetSheetCol(sheet, cell string, slice interface{}) error
根据给定的工作表名称、起始坐标和 slice 类型引用按列赋值。例如,在名为 Sheet1 的工作表 B 列上,以 B6 单元格作为起始坐标按列赋值:
err := f.SetSheetCol("Sheet1", "B6", &[]interface{}{"1&quo