gpt4 book ai didi

c# - 在 C# 中将 json 字符串写入 firestore

转载 作者:行者123 更新时间:2023-11-30 15:54:44 25 4
gpt4 key购买 nike

我有一个 json 字符串:

var jsonstr = "{ 'property1: 'myvalue','property2':2 }";
JObject json2 = JObject.Parse(jsonstr);

并想写入 firestore 但值是空数组而不是值。

var task = collection.Document("test2").SetAsync(json2);

最佳答案

NewtonSoft JSON:https://www.newtonsoft.com/json

您将要序列化您的对象。

var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All };
var text = JsonConvert.SerializeObject(configuration, settings);

关于c# - 在 C# 中将 json 字符串写入 firestore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49615737/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com