Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue asigning and converting _id value to string in aggregate concat #38

Open
dev1Okorum opened this issue Oct 14, 2016 · 0 comments
Open

Comments

@dev1Okorum
Copy link

I installed the package meteorhacks:aggregate.

I tried an aggregate function to get and concat some values without succes, my issue comes up when I assign an _id to a variable called valueid which is returning a null value.

let ciudadesTotal = ciudades.aggregate(
[
{ $project: { valueid:{$concat: "$ciudades._id".toString()}, label: { $concat: [ "$nombreMunicipio", " - ", "$nombreDepartamento" ] } } }
]
);

The structure of my collection is the following

"_id": {
"_str": "580061f6f35f931501b374e7"
},
"codigoMunicipio": 99773,
"nombreDepartamento": "Vichada",
"nombreMunicipio": "CUMARIBO",

This is what i'm geting as result of my query:

{ _id: 580061f6f35f931501b374e7,
I20161014-02:02:21.088(-5)? value: null,
I20161014-02:02:21.088(-5)? label: 'CUMARIBO - Vichada' } ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant