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

Support arrays in tjson #1721

Merged
merged 26 commits into from
Jan 3, 2023
Merged

Conversation

rumyantseva
Copy link
Member

@rumyantseva rumyantseva commented Dec 29, 2022

Description

Closes #908.

Note: "happy path" for arrays work:

test> db.hi.insert({"v":[1,2,3]})
DeprecationWarning: Collection.insert() is deprecated. Use insertOne, insertMany, or bulkWrite.
{
  acknowledged: true,
  insertedIds: { '0': ObjectId("63b3209254b793af1f0afde1") }
}
test> db.hi.find()
[ { _id: ObjectId("63b3209254b793af1f0afde1"), v: [ 1, 2, 3 ] } ]

Complicated cases, invalid arrays, and skipped tests will be covered in #1704.

Readiness checklist

  • I added unit tests for new functionality or bug fixes.
  • I added integration tests for new functionality or bug fixes.
  • I added compatibility tests for new functionality or bug fixes.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
  • I checked comments rendering with task godocs.
  • I ensured that the title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@rumyantseva rumyantseva added the code/chore Code maintenance improvements label Dec 29, 2022
@rumyantseva rumyantseva self-assigned this Dec 29, 2022
@vercel
Copy link

vercel bot commented Dec 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ferret-db ✅ Ready (Inspect) Visit Preview Jan 3, 2023 at 5:25PM (UTC)

@rumyantseva rumyantseva changed the title Add arrays support in tjson Support arrays in tjson Dec 29, 2022
@vercel vercel bot temporarily deployed to Preview December 29, 2022 16:04 Inactive
@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Merging #1721 (f1a8bd0) into main (a6f86f6) will increase coverage by 0.20%.
The diff coverage is 72.91%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1721      +/-   ##
==========================================
+ Coverage   69.00%   69.20%   +0.20%     
==========================================
  Files         301      302       +1     
  Lines       14303    14394      +91     
==========================================
+ Hits         9870     9962      +92     
+ Misses       3502     3492      -10     
- Partials      931      940       +9     
Impacted Files Coverage Δ
internal/handlers/tigris/tjson/array.go 68.51% <68.51%> (ø)
internal/handlers/tigris/tjson/schema.go 81.52% <74.28%> (+1.78%) ⬆️
internal/handlers/tigris/tjson/tjson.go 75.55% <100.00%> (+1.99%) ⬆️
build/version/version.go 63.01% <0.00%> (-4.11%) ⬇️
internal/handlers/common/filter.go 84.86% <0.00%> (ø)
internal/clientconn/listener.go 79.54% <0.00%> (+1.70%) ⬆️
internal/clientconn/conn.go 46.08% <0.00%> (+1.73%) ⬆️
internal/wire/msg_header.go 71.42% <0.00%> (+2.38%) ⬆️
... and 1 more
Flag Coverage Δ
integration 64.10% <0.00%> (-0.23%) ⬇️
mongodb 5.93% <0.00%> (-0.04%) ⬇️
pg 52.77% <0.00%> (-0.24%) ⬇️
tigris 40.53% <0.00%> (+1.69%) ⬆️
unit 29.48% <72.91%> (+0.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@vercel vercel bot temporarily deployed to Preview December 29, 2022 16:19 Inactive
@vercel vercel bot temporarily deployed to Preview January 1, 2023 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview January 1, 2023 18:54 Inactive
@vercel vercel bot temporarily deployed to Preview January 1, 2023 19:42 Inactive
@vercel vercel bot temporarily deployed to Preview January 1, 2023 19:49 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 13:15 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 13:28 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 13:43 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 13:49 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 13:53 Inactive
@vercel vercel bot temporarily deployed to Preview January 2, 2023 14:42 Inactive
@vercel vercel bot temporarily deployed to Preview January 3, 2023 11:18 Inactive
@vercel vercel bot temporarily deployed to Preview January 3, 2023 12:12 Inactive
@vercel vercel bot temporarily deployed to Preview January 3, 2023 12:18 Inactive
@rumyantseva rumyantseva marked this pull request as ready for review January 3, 2023 12:23
@rumyantseva rumyantseva requested a review from a team as a code owner January 3, 2023 12:23
@rumyantseva rumyantseva enabled auto-merge (squash) January 3, 2023 12:24
@rumyantseva rumyantseva requested review from a team and noisersup and removed request for a team January 3, 2023 12:26
w84thesun
w84thesun previously approved these changes Jan 3, 2023
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

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

LGTM!

@rumyantseva rumyantseva added no ci and removed no ci labels Jan 3, 2023
@rumyantseva rumyantseva changed the title Support arrays in tjson Support arrays in tjson... Jan 3, 2023
@rumyantseva rumyantseva changed the title Support arrays in tjson... Support arrays in tjson Jan 3, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

The arrays logic seems good, also test cases look reasonable! A few notes/questions here. Please have in mind that we can skip these notes if we want to deliver it asap and maybe discuss them later

internal/handlers/tigris/tjson/array.go Outdated Show resolved Hide resolved
internal/handlers/tigris/tjson/array.go Show resolved Hide resolved
Co-authored-by: Patryk Kwiatek <patryk@kwiatek.xyz>
@vercel vercel bot temporarily deployed to Preview January 3, 2023 17:26 Inactive
@noisersup noisersup self-requested a review January 3, 2023 17:26
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

LGTM!

@rumyantseva rumyantseva merged commit 6ad9ee5 into FerretDB:main Jan 3, 2023
@rumyantseva rumyantseva deleted the issue-908-tjson-array branch January 3, 2023 17:52
@AlekSi AlekSi added this to the v0.8.1 milestone Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for arrays in tjson
4 participants