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

Fix mongodb 3.6 aggregate #2037

Merged
merged 5 commits into from Feb 16, 2018

Conversation

Projects
None yet
5 participants
@WebFreak001
Copy link
Contributor

WebFreak001 commented Jan 14, 2018

This PR replaces the aggregate function and adds support for options and makes MongoCursor more extensible with support for any cursors instead of only find cursors

fix #2036, fix #1718

Tested with latest MongoDB 3.2, 3.4, 3.6

WebFreak001 added some commits Jan 14, 2018

fix MongoDB exception constructors
Exception constructors should use size_t for lines in order to work with std.exception.enforce
rewrite MongoCursor to a more extensible approach
fix #2036, fix #1718

cursors now only need the DocType as template argument, the find specific arguments are now in the constructor. Aggregate now uses Cursors and find was altered to the new API. There is a deprecated compatibility alias which will work in most cases (except if only Q was given and differs from what R should be, which shouldn't even be done anyway)

The new public API for aggregate is a lot more like the shell now, but still supports the old way
@timotheecour

This comment has been minimized.

Copy link

timotheecour commented Feb 13, 2018

also ran into #2036 but after patching this in vibe I get:

cd dub-registry
#edit dub.sdl to point to modified vibe
dub upgrade

dub build
lots of errors, eg:
../../../../.dub/packages/dub-1.3.0/dub/source/dub/commandline.d(1687,21): Error: no property 'length' for type 'GenericPath!(PosixPathFormat)'
diff --git a/dub.sdl b/dub.sdl
index c5e3e8a..784bf30 100644
--- a/dub.sdl
+++ b/dub.sdl
@@ -4,7 +4,9 @@ homepage "http://code.dlang.org/"
 authors "Sönke Ludwig" "Matthias Dondorff"
 license "GPL-3.0"

-dependency "vibe-d" version="~>0.8.0-beta"
+#dependency "vibe-d" version="~>0.8.0-beta"
+dependency "vibe-d" path="/Users/timothee/git_clone/D/vibe.d"
+
 dependency "dub" version="~>1.3.0-beta"
 dependency "userman" version="~>0.3.2"
 subConfiguration "dub" "library-nonet"
diff --git a/dub.selections.json b/dub.selections.json
index d99f989..eb9c385 100644
--- a/dub.selections.json
+++ b/dub.selections.json
@@ -4,17 +4,18 @@
                "backtrace-d": "~master",
                "botan": "1.12.9",
                "botan-math": "1.0.3",
-               "diet-ng": "1.4.3",
+               "diet-ng": "1.4.4",
                "dub": "1.3.0",
-               "eventcore": "0.8.15",
+               "eventcore": "0.8.27",
                "libasync": "0.8.3",
                "libev": "5.0.0+4.04",
                "libevent": "2.0.2+2.0.16",
-               "memutils": "0.4.9",
-               "openssl": "1.1.5+1.0.1g",
-               "taggedalgebraic": "0.10.7",
-               "userman": "0.3.7",
-               "vibe-core": "1.1.1",
-               "vibe-d": "0.8.1"
+               "memutils": "0.4.10",
+               "openssl": "1.1.6+1.0.1g",
+               "stdx-allocator": "2.77.0",
+               "taggedalgebraic": "0.10.9",
+               "userman": "0.3.8",
+               "vibe-core": "1.4.0-alpha.1",
+               "vibe-d": {"path":"../../../D/vibe.d"}
        }
 }
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

WebFreak001 commented Feb 13, 2018

@timotheecour try upgrading the dub dependency. I merged master into this now but now I get a completely unrelated error which complains about stream/vibe/stream/memory.d...

@timotheecour

This comment has been minimized.

Copy link

timotheecour commented Feb 13, 2018

ya i got this as well, depending on how i do things:

../../../D/vibe.d/stream/vibe/stream/memory.d(56,42): Error: constructor vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender.this (IAllocator alloc, ubyte[] initial_buffer = null) is not callable using argument types (IAllocator)
dmd failed with exit code 1.

@wilzbach

This comment has been minimized.

Copy link
Member

wilzbach commented Feb 13, 2018

That indicates that your vibe-core or vibe.d itself still uses std.experimental.allocator and not the dub package stdx-allocator.
stdx-allocator has been added to vibe.d in 0.8.3-alpha.1 and to vibe-core in 1.4.0-alpha.1 - a new release of both would make things considerably easier (see also: #2058)

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

WebFreak001 commented Feb 13, 2018

huh on the test servers it paseses so I guess it's not broken ¯\_(ツ)_/¯

@s-ludwig

This comment has been minimized.

Copy link
Member

s-ludwig commented Feb 16, 2018

I'll have to see whether we can improve the transition from std.experimental.allocator to stdx.allocator with reasonable effort, before tagging the next release. Having to upgrade both, vibe-d and vibe-core at the same time is not really nice and also not really compatible with the intent of SemVer, even if this is private code.

@s-ludwig s-ludwig added auto-merge and removed needs review labels Feb 16, 2018

@dlang-bot dlang-bot merged commit 283fe17 into vibe-d:master Feb 16, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment