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
1414
1515PLATFORM=" linux-x64"
1616
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
2024fi
2125
2226DOWNLOAD_URL=" https://downloads.mongodb.com/compass/mongosh-${MONGOSH} -${PLATFORM} .tgz"
2327TARBALL=" mongosh-${MONGOSH} -${PLATFORM} .tgz"
2428
2529echo " Downloading mongosh ${MONGOSH} for ${PLATFORM} ..."
26- if ! wget -q --show-progress " $DOWNLOAD_URL " ; then
30+ if ! wget --quiet " $DOWNLOAD_URL " ; then
2731 echo " Failed to download mongosh. Please check the version and your internet connection."
2832 exit 1
2933fi
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*")
77mkdir $mongodb_dir /data
88
99args=(--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
1115 args+=(--setParameter maxTransactionLockRequestTimeoutMillis=1000)
1216fi
1317
1418$mongodb_dir /bin/mongod " ${args[@]} "
1519
16- if (( $(echo " $MONGODB < 6 . 0 " | bc - l) )) ; then
20+ if [ " $MAJOR " -lt 6 ] ; then
1721mongo --verbose --eval " rs.initiate()"
1822mongo --quiet --eval " rs.status().ok"
1923else
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ Dependencies
5858All of the dependencies can easily be installed via `python -m pip <https://pip.pypa.io/ >`_.
5959At the very least, you'll need these two packages to use MongoEngine:
6060
61- - pymongo>=3.4
61+ - pymongo>=3.12
6262
6363If you utilize a ``DateTimeField ``, you might also use a more flexible date parser:
6464
You can’t perform that action at this time.
0 commit comments