You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Aman202600 (via GitHub)" <gi...@apache.org> on 2025/12/10 17:57:29 UTC

[PR] Split MongoDB service into new opendal-services-mongodb crate (RFC-6828) [opendal]

Aman202600 opened a new pull request, #6963:
URL: https://github.com/apache/opendal/pull/6963

   # Which issue does this PR close?
   
   Closes #6908  
   
   This PR is part of the RFC-6828 core-split initiative.
   
   Tracking issue: #6829  
   
   # Rationale for this change
   
   As part of RFC-6828, all storage backends are being moved out of `opendal-core` into separate crates
   to reduce core complexity, simplify maintenance, and isolate service-specific dependencies.
   
   This PR moves the MongoDB backend into the new `opendal-services` workspace as required by the core-split plan.
   
   # What changes are included in this PR?
   
   - Extracted MongoDB backend from `core/services/mongodb` into new crate: `opendal-services/mongodb`
   - Converted imports to use `opendal_core` instead of `crate`
   - Preserved all public APIs and existing behavior exactly as before
   - Added `mongodb` feature flag to the root `Cargo.toml`
   - Re-exported `Mongodb` and `MongodbConfig` from the `opendal` crate
   - Added new `opendal-services/mongodb/Cargo.toml`
   - Updated documentation (`docs.md`) for new crate path
   - Ensured no registration macro (`ctor`) is used in the new service crate
   - Cleaned up mod.rs structure into proper `lib.rs`
   
   # Are there any user-facing changes?
   
   No.
   
   This is an internal restructuring only.  
   All APIs, builder patterns, configuration keys, and runtime behavior remain identical.
   
   # Breaking changes?
   
   None.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Split MongoDB service into new opendal-services-mongodb crate [opendal]

Posted by "koushiro (via GitHub)" <gi...@apache.org>.
koushiro closed pull request #6963: refactor: Split MongoDB service into new opendal-services-mongodb crate
URL: https://github.com/apache/opendal/pull/6963


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Split MongoDB service into new opendal-services-mongodb crate [opendal]

Posted by "koushiro (via GitHub)" <gi...@apache.org>.
koushiro commented on PR #6963:
URL: https://github.com/apache/opendal/pull/6963#issuecomment-3678605082

   @Aman202600 Thanks for your work, but we have to close this PR now (other contributors have completed this task), hope to see your contributions again in the future.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: Split MongoDB service into new opendal-services-mongodb crate [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #6963:
URL: https://github.com/apache/opendal/pull/6963#discussion_r2609816713


##########
opendal-services/src/backend.rs:
##########
@@ -34,74 +36,43 @@ pub struct MongodbBuilder {
 }
 
 impl MongodbBuilder {
-    /// Set the connection_string of the MongoDB service.
-    ///
-    /// This connection string is used to connect to the MongoDB service. It typically follows the format:
-    ///
-    /// ## Format
-    ///
-    /// `mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]`
-    ///
-    /// Examples:
-    ///
-    /// - Connecting to a local MongoDB instance: `mongodb://localhost:27017`
-    /// - Using authentication: `mongodb://myUser:myPassword@localhost:27017/myAuthDB`
-    /// - Specifying authentication mechanism: `mongodb://myUser:myPassword@localhost:27017/myAuthDB?authMechanism=SCRAM-SHA-256`
-    ///
-    /// ## Options
-    ///
-    /// - `authMechanism`: Specifies the authentication method to use. Examples include `SCRAM-SHA-1`, `SCRAM-SHA-256`, and `MONGODB-AWS`.
-    /// - ... (any other options you wish to highlight)
-    ///
-    /// For more information, please refer to [MongoDB Connection String URI Format](https://docs.mongodb.com/manual/reference/connection-string/).
     pub fn connection_string(mut self, v: &str) -> Self {
         if !v.is_empty() {
             self.config.connection_string = Some(v.to_string());
         }
         self
     }
-    /// Set the working directory, all operations will be performed under it.

Review Comment:
   The same



##########
opendal-services/mongodb/Cargo.toml:
##########
@@ -0,0 +1,19 @@
+[package]
+name = "opendal-services-mongodb"

Review Comment:
   Hi, package name should be `opendal-service-mongodb`



##########
opendal-services/mongodb/Cargo.toml:
##########
@@ -0,0 +1,19 @@
+[package]
+name = "opendal-services-mongodb"
+version = "0.1.0"

Review Comment:
   version should align with other crates.



##########
opendal-services/src/backend.rs:
##########
@@ -139,21 +112,27 @@ impl Builder for MongodbBuilder {
                 );
             }
         };
-        let key_field = match &self.config.key_field.clone() {
-            Some(v) => v.clone(),
-            None => "key".to_string(),
-        };
-        let value_field = match &self.config.value_field.clone() {
-            Some(v) => v.clone(),
-            None => "value".to_string(),
-        };
+

Review Comment:
   Please don't introduce not related changes.



##########
opendal-services/src/backend.rs:
##########
@@ -34,74 +36,43 @@ pub struct MongodbBuilder {
 }
 
 impl MongodbBuilder {
-    /// Set the connection_string of the MongoDB service.

Review Comment:
   Why remove those code? I expect all exist code not changed.



##########
opendal-services/src/writer.rs:
##########
@@ -15,21 +15,18 @@
 // specific language governing permissions and limitations
 // under the License.
 
-/// Default scheme for mysql service.
-pub const MYSQL_SCHEME: &str = "mysql";
+/// Default scheme for mongodb service.
+pub const MONGODB_SCHEME: &str = "mongodb";
+
 
-use opendal_core::DEFAULT_OPERATOR_REGISTRY;
 
 mod backend;
 mod config;
 mod core;
 mod deleter;
 mod writer;
 
-pub use backend::MysqlBuilder as Mysql;
-pub use config::MysqlConfig;
+pub use backend::MongodbBuilder as Mongodb;
+pub use config::MongodbConfig;
+
 

Review Comment:
   This is critical for our register logic.



##########
opendal-services/mongodb/Cargo.toml:
##########
@@ -0,0 +1,19 @@
+[package]
+name = "opendal-services-mongodb"
+version = "0.1.0"
+edition = "2021"

Review Comment:
   We should use `2024` edition



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org