Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
mongo ドキュメントは、複数の値を持つキーを持つことができます。たとえば。電話番号には複数の値を指定できます。C# ドライバー API を使用して、この配列を挿入したいと考えています。そのような値を挿入する方法を教えてください。ありがとう。
これは非常に簡単に行うことができます。
BsonDocument doc = new BsonDocument(); BsonArray phones = new BsonArray(); phones.Add("123-456-7890"); phones.Add("234-567-8901"); doc.Add("phones", phones); collection.Insert(doc);
これがあなたが探しているものでない場合は、お知らせください。