Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo engine优化 #2018

Merged
merged 6 commits into from
Jan 14, 2023
Merged

mongo engine优化 #2018

merged 6 commits into from
Jan 14, 2023

Conversation

nick2wang
Copy link
Collaborator

@nick2wang nick2wang commented Jan 4, 2023

  1. 优化method的取值逻辑
// 很多时候mongo的dml更新内容诸如文件名或毫秒时间包含点号".",导致method取值错误
db.getCollection("abc").update({ _id: ObjectId("51b41a07913be10daxcb5d9a")}, {
    fileName: "现金明细20230103075728.xls",
    contentType: ".xls",
    createdTime: ISODate("2023-01-03T12:05:27.402Z"),
    reportDate: ISODate("2023-01-03T12:05:27.402Z"),
    updatedTime: ISODate("2023-01-03T12:09:30.88Z")
});
  1. 支持显示DML影响行数
  2. 修复执行报错仍显示正常结束的bug

@nick2wang
Copy link
Collaborator Author

python-dev似乎已经包含在python中不需要额外安装

sudo apt-get update && sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev unixodbc unixodbc-dev

@nick2wang nick2wang changed the title 优化mongo的method取值逻辑 mongo engine优化 Jan 6, 2023
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Base: 74.50% // Head: 75.08% // Increases project coverage by +0.58% 🎉

Coverage data is based on head (8c35ffa) compared to base (eba3e33).
Patch coverage: 78.20% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2018      +/-   ##
==========================================
+ Coverage   74.50%   75.08%   +0.58%     
==========================================
  Files         102      102              
  Lines       14685    14759      +74     
==========================================
+ Hits        10941    11082     +141     
+ Misses       3744     3677      -67     
Impacted Files Coverage Δ
sql/engines/mongo.py 61.21% <66.00%> (+11.42%) ⬆️
sql/engines/tests.py 99.78% <100.00%> (+0.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有希望加一加测试吗, 还挺多代码的

@nick2wang
Copy link
Collaborator Author

有希望加一加测试吗, 还挺多代码的

单元测试已补充

@hhyo hhyo merged commit c0f41a4 into hhyo:master Jan 14, 2023
@nick2wang nick2wang deleted the optimize-mongo-method-name branch January 14, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants