mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.62k stars 1.25k forks source link

saving text removes white space and line breaks at the beginning and end of text #2132

Closed cl2raul66 closed 2 years ago

cl2raul66 commented 2 years ago

hello, I try to save a text string like this: " I am your master \n ", but when I recover it looks like this: "I am your master"

cl2raul66 commented 2 years ago

How can I do that?

kcsombrio commented 2 years ago

Hi @cl2raul66, in your case, try setting the BsonMapper.Global.TrimWhitespace to false. It's default value is true. Please see more info at http://www.litedb.org/docs/object-mapping/