mongodb-user
[Arriba] [Todas las Listas]

[mongodb-Usuario] $suma dos campos

To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Subject: [mongodb-Usuario] $suma dos campos
From: Andr3 <spacecss@xxxxxxxxx>
Date: Wed, 30 Sep 2015 03:27:20 -0700 (PDT)
Delivery-date: Wed, 30 Sep 2015 06:39:23 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:subject:mime-version:content-type :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe; bh=EcTFHJaOB3Xvq3xJXtW3q02Vqy1BA4S9DtrYYeiAS7k=; b=BJlYqR59A0ZK+pG19hE16FUEysrJbcP7kV555Nsb3dqcEQkEbrECxjJzqtkKqFFSmA J/gi3+gXOlVWubNbF2uUMNFeEWRGO1Y4g9m3B1BPhG7zBFV48J/ewTvNUMpPNNV0LpZJ YTeAL8Gz33pvG2EUQxOxQoviQMZFltxeHU8CzmP8e8W1zb+nCEoUg+VsqHU+anzaIN/M DnZyVwvXTaEk/VUx7R6zUzsGSIm56bBdVhPkiZdG9dXi6sTt6aZnEvrmurS2ljEuaTG0 Z7ZGpFZ3j+WYCsAjFXeXGWcXtvXW1+qERNetIIBcxfTt6zq6arNepNq8caFq/cw/qGFq iV8Q==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:subject:mime-version:content-type :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe; bh=EcTFHJaOB3Xvq3xJXtW3q02Vqy1BA4S9DtrYYeiAS7k=; b=NckUIg/2XyLPOzaZX/YYuKEYsxTwZtkFQJriuo/Q/CwiLryVU2eFdzIuENqiCr2wv+ 83zNGfUyzfb3GgNnkBpjW9qH14aJHCnX4t8wf07Bt+x2BONzikWImwmI+YyCdGvtjqT3 1JNJQxseapaVfgHGx/Djh8RVDh08cjdklYhVND5/792aUx717faHJKs3RWH6H9lIscXT 22+ruZS8tL4uIIDuGVGvLO2oyE8/QqSG5FSYSD952r5mOQQlGP8RJJoYIaMZV+bptOXD vY+yPfaHRw5mA7ndnOvMh2l1ETHa2oGkuq8wYa/DAYoD5+Nla+YZRP3h85iKxcrNb+kJ DNNQ==
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <http://groups.google.com/group/mongodb-use>
List-help: <http://groups.google.com/support/>, <mailto:mongodb-user+help@googlegroups.com>
List-id: <mongodb-user.googlegroups.com>
List-post: <http://groups.google.com/group/mongodb-user/post>, <mailto:mongodb-user@googlegroups.com>
List-subscribe: <http://groups.google.com/group/mongodb-user/subscribe>, <mailto:mongodb-user+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+1044811755470+unsubscribe@googlegroups.com>, <http://groups.google.com/group/mongodb-user/subscribe>
Mailing-list: list mongodb-user@xxxxxxxxxxxxxxxx; contact mongodb-user+owners@xxxxxxxxxxxxxxxx
Reply-to: mongodb-user@xxxxxxxxxxxxxxxx
Sender: mongodb-user@xxxxxxxxxxxxxxxx
Hola,

estoy intentando añadir dos campos. En el momento, conseguía esto:

[ $#nom : "#nom" : "2015" } }, $#nom : "_#unknown{^*id" : *null, "Total1" : "$#nom" : "$*T1" }, "Total2" : 
"$#nom" : "$*T2}  } }
]


Resultado:

_*id
Total1
Total2
1718
1703

necesito $suma tanto números, Total TOTAL1 + Total2

pero no sé cómo para continuar...

Cualesquier sugerencias?

*Thanks!

-- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*mongodb-grupo"
de usuario.

Para otro *MongoDB opciones de apoyo técnico, ve: *http://www.mongodb.org/sobre/apoyo/.
--- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*mongodb-grupo" de usuario.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *mongodb-usuario+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a *mongodb-user@xxxxxxxxxxxxxxxx.
Visita este grupo en *http://grupos.*google.*com/Grupo/*mongodb-usuario.
Para ver esta discusión en la visita de web *https://grupos.*google.*com/*d/*msgid/*mongodb-Usuario/5*d4*cd34*f-8*cca-4583-807*d-*e58695414*e5*b%40*googlegroups.*com.
Para más opciones, visita *https://grupos.*google.*com/*d/*optout.
Hello,

I'm trying to add two fields. At the moment, I got this:

[
{ $match : { "YEAR" : "2015" } },
{ $group : { "_id" : null, "Total1" : { "$sum" : "$T1" }, "Total2" : { 
"$sum" : "$T2}  } }
]


Result:

_id
Total1
Total2
1718
1703

I need $sum both numbers, TOTAL = Total1 + Total2

but I don't know how to continue...

Any suggestions?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/5d4cd34f-8cca-4583-807d-e58695414e5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>