提交 3f024e1f 编写于 作者: 雪洛's avatar 雪洛

docs: uniCloud database geo new

上级 1816b1e3
...@@ -4242,12 +4242,12 @@ const dbCmd = db.command ...@@ -4242,12 +4242,12 @@ const dbCmd = db.command
const { Point, LineString, Polygon } = db.Geo const { Point, LineString, Polygon } = db.Geo
let res = await .collection('restaurants').where({ let res = await .collection('restaurants').where({
location: dbCmd.geoWithin({ location: dbCmd.geoWithin({
geometry: Polygon([ geometry: new Polygon([
LineString([ new LineString([
Point(0, 0), new Point(0, 0),
Point(3, 2), new Point(3, 2),
Point(2, 3), new Point(2, 3),
Point(0, 0) new Point(0, 0)
]) ])
]), ]),
}) })
...@@ -4290,12 +4290,12 @@ const dbCmd = db.command ...@@ -4290,12 +4290,12 @@ const dbCmd = db.command
const { Point, LineString, Polygon } = db.Geo const { Point, LineString, Polygon } = db.Geo
let res = await db.collection('restaurants').where({ let res = await db.collection('restaurants').where({
location: dbCmd.geoIntersects({ location: dbCmd.geoIntersects({
geometry: Polygon([ geometry: new Polygon([
LineString([ new LineString([
Point(0, 0), new Point(0, 0),
Point(3, 2), new Point(3, 2),
Point(2, 3), new Point(2, 3),
Point(0, 0) new Point(0, 0)
]) ])
]), ]),
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册