Mongoose Queries based on MAP API

For our REST API Server we need MongoDB Queries with Mongoose. The server response is always a JSON object. I will provide to you all of our Schemas.

You would have to write the APIs yourself by setting up a NodeJS server with ExpressJS. The queries will have to be written in Mongoose. I will provide Schemas and some Mock Data.

We have a couple of different collections.

The Apartment Collection


Relevant fields for this description:


address: { street: {...}, house_nr: {...}, zip: {...}, city: {...}, country: {...} }

ownder_id: {...}

distance_to_owner_office_in_km: {...}

time_by_car_to_owner_office: {...}

The Owner Collection


Relevant fields for this description:


office_address: { street: {...}, house_nr: {...}, zip: {...}, city: {...}, country: {...} }

The Viewing Collection


Relevant fields for this description:


apartment_id: {...}

1st Task:

Choose a good MAP API that can give me back KM & Time (to drive by car) for 2 addresses and that is cheap or for many requests for free. Come up with some good suggestions.

If you have some good reasons for Google Maps API then so be it. But maybe you have look for some good alternatives.

This article could help you: [login to view URL]

2nd Task:

For an Apartment I need




to be calculated based on the two addresses (Apartment Address and Owner Address).

Please put (q k x) before the title of your proposal starts. I need to see if you read my specs in detail. Thank you. Back to the description:

The API / Query should go as follows:

Case 1: if distance_to_owner_office_in_km >= XYZ_km, then


1st) Calculate how many viewings are there for this apartment ==> based on viewing.apartment_id. Let this number be ==> num_viewings

2nd) Calculation and JSON Response

[num_viewings] x [distance_to_owner_office_in_km] x 2 = [KM_travelled]

(it is x2 at the end because going back and forth)

[num_viewings] x [time_by_car_to_owner_office] x 2 = [TIME_spent]

Case 2: if distance_to_owner_office_in_km < XYZ_km, then


The same thing but instead of taking just num_viewings we group them in batches of 10.

So basically:

[KM_travelled] = round( [num_viewings] / 10 ) x [distance_to_owner_office_in_km] x 2

if( [num_viewings] % 10 != 0){

//with modulo operation we calculate if there is rest

//this means the rest is a group on its own

[KM_travelled] = [KM_travelled] + [distance_to_owner_office_in_km] x 2


==> the same for [time_by_car_to_owner_office] in Case 2 as well.

For all these APIs / Queries the inputs should be:

1. apartment_id

2. XYZ_km

Compétences : Express JS, JavaScript, MongoDB, Node.js

en voir plus : google api map generatot, gps vector based map, flash based map database, mongoose find all, mongoose populate, mongoose find, mongoose updateone, virtual in mongoose, mongoose document versioning, mongoose findoneandupdate, mongoose createindexes, flash based map zoom zoom, tile based map editor rpgxp, map key inputs, web based map routing, google map user inputs update, tile based map file format, xml based quiz user inputs as2, proposal title sponsorship, gps location based map android source code

Concernant l'employeur :
( 9 commentaires ) Zurich, Switzerland

Nº du projet : #19209317

Décerné à:


q k x Hi, So I read the article and among mentioned APIs, I'm a bit(least bit) familiar with Mapbox. It offers Matrix API in Navigation which calculates the distance and time based on 2 or more coordinates(lat, l Plus

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 5 jours
(25 Commentaires)

7 freelances font une offre moyenne de 161 $ pour ce travail


Hi I have read your requirements carefully. I am high skilled and rich experienced in Node/express/Mongoose. If you share more details,I can start work. Best Regards.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(85 Commentaires)

Hi there, Thank you for sharing your requirement. Hope you are doing good and having a nice day. We are a team of technocrats having 8+ years of experience in Web and Mobile design plus development and primarily Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(33 Commentaires)

Full stack experienced developer as I m experienced developer,I can finish project very fast I m very interesting about your job I have experienced about mongoose for api part,I have experienced about curl and aj Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(58 Commentaires)

I am a senior web applications developer with 5+ years of proven Profile in various projects and technologies, and a total of 6+ total years of expertise in web programming. In my web development practice I used differ Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 6 jours
(15 Commentaires)

Hi, there - My name is Dipesh. I've read your job description and I am very interested in this project because I have good proficiency with React, Node, and MongoDB. I have 4+ years of development experience buildin Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(4 Commentaires)

(q k x) Hi, I've experience in developing full stack web applications based on MongoDB Express React and Node. If you are interested, I can show my past work. Please feel free to suggest alternatives to milestones. Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(1 Évaluation)