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の配列の先頭にアトミックに値を追加するにはどうすればよいですか?
ご指導ありがとうございます。
このチケットのように直接行うことはできません。
今のところ唯一のオプションは、配列をフェッチし、要素を最初に配置して、再度mongoに配置することです。
someArray.unshift(someValue);
例えば
> x = [1,2,3] [1, 2, 3] > x.unshift(0) 4 > x [0, 1, 2, 3]