I want to store geospatial data in MongoDB to be s...
# orm-help
s
I want to store geospatial data in MongoDB to be specific polygon data: *I want to store in this format and so far I don't know any way to store this format data with Prisma datamodel*(if yes then its may solve my issue)
Copy code
javascript
{
  ...otherFields,
  area: {
    type: "Polygon",
    coordinates: [
      [
        [longitude(float), latitude(float)],
        ...
        [longitude(float), latitude(float)]
      ]
    ]
  }
}
EXCEPT Json format but the problem with JSON is the Prisma store JSON as a string that means I cannot create an index for that field to run geospatial queries with native MongoDB (since as far as I know there is no way to do a geospatial query with Prisma). Now let's say if I do all thing from inserting, updating, reading data from native MongoDB for specific that data along with side Prisma then when I run
Copy code
prisma deploy
it will wipe out all my data which I wrote manually to the database without in contact with Prisma, and since I wrote most of my resolvers with Prisma now I cannot write all of them in native MongoDB(or using other ORM or library) due to project deadline, now, what am I supposed to do? Versions (please complete the following information): - Connector:
MongoDB
- Prisma Server:
1.34.0
-
prisma
CLI: prisma/1.34.10 (linux-x64) node-v10.16.3 - OS:
Ubuntu 19.04
- other dependencies:
prisma-client