Answer the question
In order to leave comments, you need to log in
How to change the value of an entry?
Good afternoon,
There is a collection battles = new Mongo.Collection('battles');
It is filled with records of this type
var BS = new BattleState(path, 20, 12,prevuser.deck,user.deck);
battles.insert({
ID1 : prevuser.userId,
name1 : prevuser.username,
ID2 : user.userId,
name2 : user.username,
BS : BS,
battleID: path
});
BattleState = function(ID, sizeX, sizeY, deck1, deck2)
{
var mapHash = setMapHash(sizeX, sizeY);
this.map = createMap(mapHash, sizeX, sizeY);//{}
this.deck1 = deck1;//[]
this.deck2 = deck2;//[]
};
Answer the question
In order to leave comments, you need to log in
Solved the problem by editing the entire deck and overwriting it entirely
deck=battles.findOne({}).BS.deck1;
deck[card].column=column;
deck[card].row=row;
deck[card].placed=true;
battles.update(_id,{$set:{'BS.deck1':deck}});
working with arrays in mongo is very easy, just specify the index.
var deck = {column: column,
row: row,
placed: true };
battles.update(_id, {$set: { 'BS.deck1.0': deck}});
Your requirements are low. Here you drive in the characteristics of interest and look for a suitable option.
Apparently, almost any laptop will cope with your tasks.
I can only advise the possibility of expanding the RAM up to 16GB (it will not be superfluous), and an SSD (well, or a slot for it)
unlike previous commentators, I would recommend not to buy laptops in our country, but to buy on the same computeruniverse.ru - it’s not always much cheaper there (laptops are usually cheaper by 5-10 thousand), but there is a much larger selection of different configurations. for example, Acer V3 on i5, with 8 gigs of RAM, SSD and 1080 screen in Moscow time. didn't exist when I was looking. and the same model with 6GB of memory cost about 50k, when in Germany it cost 30k.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question