package Ġcom . tencent . devops . common . db Ċ Ċ import Ġcom . mongodb . Read Concern Ċ import Ġcom . mongodb . Transaction Options Ċ import Ġcom . mongodb . Write Concern Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . data . mongodb . Mongo Database Factory Ċ import Ġorg . springframework . data . mongodb . Mongo Transaction Manager Ċ import Ġorg . springframework . data . mongodb . core . convert . Default Db Ref Resolver Ċ import Ġorg . springframework . data . mongodb . core . convert . Mapping Mongo Converter Ċ import Ġorg . springframework . data . mongodb . core . mapping . Mongo Mapping Context Ċ import Ġorg . springframework . data . mongodb . repository . config . Enable Mongo Repositories Ċ Ċ @ Suppress (" Max Line Length ") Ċ @ Configuration Ċ @ Enable Mongo Repositories ( base Packages Ġ= Ġ[" com . tencent . devops . tur bo "]) Ċ class ĠMongo Custom Config Ġ{ ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtransaction Manager ( factory : ĠMongo Database Factory ): ĠMongo Transaction Manager Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Options Ġ= ĠTransaction Options . builder (). read Concern ( Read Concern . LOCAL ). write Concern ( Write Concern . W 1 ). build () ĊĠĠĠĠĠĠĠ Ġreturn ĠMongo Transaction Manager ( factory , Ġtransaction Options ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġcustom Converters ( ĊĠĠĠĠĠĠĠ Ġmong od atabase Factory : ĠMongo Database Factory , ĊĠĠĠĠĠĠĠ Ġmongo Mapping Context : ĠMongo Mapping Context ĊĠĠĠ Ġ): ĠMapping Mongo Converter Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdb Ref Resolver Ġ= ĠDefault Db Ref Resolver ( mong od atabase Factory ) ĊĠĠĠĠĠĠĠ Ġval Ġmapping Mongo Converter Ġ= ĠMapping Mongo Converter ( db Ref Resolver , Ġmongo Mapping Context ) ĊĠĠĠĠĠĠĠ Ġmapping Mongo Converter . set Map Key Dot Replacement (" ~ ") ĊĠĠĠĠĠĠĠ Ġreturn Ġmapping Mongo Converter ĊĠĠĠ Ġ} Ċ } Ċ