I try to do some integer math in mongodb and have some problems. Is there a way to round doubles up or down in the mongo db aggregation framework?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As per the comment from Stennie, the floor and ceiling methods are not supported.
And as per my comment above, the best solution that I could find was just doing an operation that looks like: (num-mod(num,1)) which should yield the same result as the floor function.