We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4d30a5 commit 968f79fCopy full SHA for 968f79f
1 file changed
module-bsonkt/src/commonMain/kotlin/BsonDocumentLike.kt
@@ -254,6 +254,23 @@ infix fun String.by(block: BsonDocumentBlock) {
254
builder[this] = BsonDocument(block)
255
}
256
257
+@BsonMarker2
258
+context(builder: BsonDocumentBuilder)
259
+infix fun String.flatBy(value: BsonDocumentLike?) {
260
+ value ?: return run { builder[this] = null.bson }
261
+ value.forEach { (name, value) ->
262
+ builder["${this}.${name}"] = value
263
+ }
264
+}
265
+
266
267
268
+infix fun String.flatBy(block: BsonDocumentBlock) {
269
+ BsonDocument(block).forEach { (name, value) ->
270
271
272
273
274
/* ============= ------------------ ============= */
275
276
/**
0 commit comments