-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix MongoDB URL mapping for trailing slashes in path template matching
- Loading branch information
Showing
11 changed files
with
44 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,6 @@ | |
*/ | ||
package org.restheart.mongodb.db.sessions; | ||
|
||
import com.mongodb.ClientSessionOptions; | ||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.MongoQueryException; | ||
|
||
import static com.mongodb.client.model.Filters.eq; | ||
|
||
import java.util.Optional; | ||
import java.util.UUID; | ||
|
||
|
@@ -34,6 +28,11 @@ | |
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.mongodb.ClientSessionOptions; | ||
import com.mongodb.MongoQueryException; | ||
import com.mongodb.client.MongoClient; | ||
import static com.mongodb.client.model.Filters.eq; | ||
|
||
/** | ||
* | ||
* @author Andrea Di Cesare {@literal <[email protected]>} | ||
|
@@ -175,7 +174,7 @@ private static long getTxnNumFromExc(MongoQueryException mqe) { | |
private static final String TXN = "txnNumber"; | ||
/** | ||
* errorMsg can be the transaction number or: | ||
* - from MongoDb 6: with txnNumberAndRetryCounter { txnNumber: 10, txnRetryCounter: 0 } | ||
* - from MongoDB 6: with txnNumberAndRetryCounter { txnNumber: 10, txnRetryCounter: 0 } | ||
* - from MongoDB 5: with { txnNumber: 10 } | ||
* - from MongoDB < 5: with txnNumber 10 | ||
* @param errorMsg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,12 @@ | |
*/ | ||
package org.restheart.mongodb.services; | ||
|
||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.client.model.FindOneAndUpdateOptions; | ||
import io.undertow.server.HttpServerExchange; | ||
import java.util.ArrayDeque; | ||
import java.util.Deque; | ||
import java.util.function.Consumer; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
|
||
import org.bson.BsonDocument; | ||
import org.bson.BsonString; | ||
import org.bson.BsonValue; | ||
|
@@ -38,11 +36,16 @@ | |
import org.restheart.plugins.Inject; | ||
import org.restheart.plugins.RegisterPlugin; | ||
import org.restheart.plugins.Service; | ||
import org.restheart.utils.HttpStatus; | ||
import org.restheart.utils.BsonUtils; | ||
import org.restheart.utils.HttpStatus; | ||
|
||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.client.model.FindOneAndUpdateOptions; | ||
|
||
import io.undertow.server.HttpServerExchange; | ||
|
||
/** | ||
* service to upload a csv file in a MongoDb collection | ||
* service to upload a csv file in a MongoDB collection | ||
* | ||
* query parameters:<br> | ||
* - db=<db_name> *required<br> | ||
|
@@ -60,7 +63,7 @@ | |
* @author Andrea Di Cesare {@literal <[email protected]>} | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
@RegisterPlugin(name = "csvLoader", description = "Uploads a csv file in a MongoDb collection", secure = true, defaultURI = "/csv") | ||
@RegisterPlugin(name = "csvLoader", description = "Uploads a csv file in a MongoDB collection", secure = true, defaultURI = "/csv") | ||
public class CsvLoader implements Service<BsonFromCsvRequest, BsonResponse> { | ||
/** | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters