File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,20 @@ MONGOSH=$2
14
14
15
15
PLATFORM=" linux-x64"
16
16
17
- if (( $(echo "$MONGODB < 6 .0 " | bc - l) )) ; then
18
- echo " mongosh is not needed for MongoDB versions less than 6.0"
19
- exit 0
17
+ # Extract major version explicitly
18
+ MONGODB_MAJOR_VERSION=$( echo " $MONGODB " | cut -d' .' -f1)
19
+
20
+ # Check if MongoDB major version is greater than or equal to 6
21
+ if [ " $MONGODB_MAJOR_VERSION " -lt 6 ]; then
22
+ echo " mongosh is not needed for MongoDB versions less than 6.0"
23
+ exit 0
20
24
fi
21
25
22
26
DOWNLOAD_URL=" https://downloads.mongodb.com/compass/mongosh-${MONGOSH} -${PLATFORM} .tgz"
23
27
TARBALL=" mongosh-${MONGOSH} -${PLATFORM} .tgz"
24
28
25
29
echo " Downloading mongosh ${MONGOSH} for ${PLATFORM} ..."
26
- if ! wget -q --show-progress " $DOWNLOAD_URL " ; then
30
+ if ! wget --quiet " $DOWNLOAD_URL " ; then
27
31
echo " Failed to download mongosh. Please check the version and your internet connection."
28
32
exit 1
29
33
fi
Original file line number Diff line number Diff line change @@ -7,13 +7,17 @@ mongodb_dir=$(find ${PWD}/ -type d -name "mongodb-linux-x86_64*")
7
7
mkdir $mongodb_dir /data
8
8
9
9
args=(--dbpath $mongodb_dir /data --logpath $mongodb_dir /mongodb.log --fork --replSet mongoengine)
10
- if (( $(echo "$MONGODB > 3 .8 " | bc - l) )) ; then
10
+
11
+ # Parse version components
12
+ MAJOR=$( echo " $MONGODB " | cut -d' .' -f1)
13
+ MINOR=$( echo " $MONGODB " | cut -d' .' -f2)
14
+ if [ " $MAJOR " -gt 3 ] || ([ " $MAJOR " -eq 3 ] && [ " $MINOR " -ge 8 ]); then
11
15
args+=(--setParameter maxTransactionLockRequestTimeoutMillis=1000)
12
16
fi
13
17
14
18
$mongodb_dir /bin/mongod " ${args[@]} "
15
19
16
- if (( $(echo " $MONGODB < 6 . 0 " | bc - l) )) ; then
20
+ if [ " $MAJOR " -lt 6 ] ; then
17
21
mongo --verbose --eval " rs.initiate()"
18
22
mongo --quiet --eval " rs.status().ok"
19
23
else
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ Dependencies
58
58
All of the dependencies can easily be installed via `python -m pip <https://pip.pypa.io/ >`_.
59
59
At the very least, you'll need these two packages to use MongoEngine:
60
60
61
- - pymongo>=3.4
61
+ - pymongo>=3.12
62
62
63
63
If you utilize a ``DateTimeField ``, you might also use a more flexible date parser:
64
64
You can’t perform that action at this time.
0 commit comments