firebase-tools :
firebase : 7.1.1
๋
ธ๋ : v10.16.0
์๋ฐ : 11.0.2
ํ๋ซํผ:
๋งฅ OS
์ด ์ค์ ํ์๋ฉ๋๋ค. firebase-tools / functionsEmulator.ts at dad143c42445056014f6f48cc9dfa13156e3c186 ยท firebase / firebase-tools ยท GitHub
, ์ ํธ๋ฆฌ๊ฑฐ ์ถ๊ฐ ์์ฒญ์ด ๋ชฉ๋ก์ ์ถ๊ฐ๋์ง ์๊ณ ์ถ๊ฐ ๋ ์ด์ ํธ๋ฆฌ๊ฑฐ๋ฅผ ์ฌ์ ์ํฉ๋๋ค.
curl ' http : // localhost : 9000 / .settings / functionTriggers.json? ns = test-project'-X PUT -H 'authorization : Bearer owner'--data-binary '[{ "name": "projects / test -project / locations / _ / functions / NewPost ","path ":"/ posts / {ownerId} / {postId} ","event ":"providers / google.firebase.database / eventTypes / ref.create "," topic ":"projects / test-project / topics / NewPost "}] '--compressed
{ "status": "ok"}
curl ' http : // localhost : 9000 / .settings / functionTriggers.json? ns = test-project'-H '๊ถํ : ๋ฒ ์ด๋ฌ ์์ ์'-์์ถ
[{ "name": "projects / test-project / locations / _ / functions / NewPost", "path": "/ posts / {ownerId} / {postId}", "event": "providers / google.firebase. database / eventTypes / ref.create ","topic ":"projects / test-project / topics / NewPost "}]
curl ' http : // localhost : 9000 / .settings / functionTriggers.json? ns = test-project'-X PUT -H 'authorization : Bearer owner'--data-binary '[{ "name": "projects / test -project / locations / _ / functions / UpdatePost ","path ":"/ posts / {ownerId} / {postId} ","event ":"providers / google.firebase.database / eventTypes / ref.update "," topic ":"projects / test-project / topics / UpdatePost "}] '--compressed
{ "status": "ok"}
curl ' http : // localhost : 9000 / .settings / functionTriggers.json? ns = test-project'-H '๊ถํ : ๋ฒ ์ด๋ฌ ์์ ์'-์์ถ
[{ "name": "projects / test-project / locations / _ / functions / UpdatePost", "path": "/ posts / {ownerId} / {postId}", "event": "providers / google.firebase. database / eventTypes / ref.update ","topic ":"projects / test-project / topics / UpdatePost "}]
๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ํธ๋ฆฌ๊ฑฐ๊ฐ ๋ชจ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๋ฎฌ๋ ์ดํฐ์ ์ถ๊ฐ๋๊ณ ๋์ด๋ฉ๋๋ค.
๊ฐ ํธ์ถ์ด ์ด์ ํธ์ถ๋ณด๋ค ์ฐ์ ํฉ๋๋ค.
@gpfunk ๋ณด๊ณ
์ด๊ฒ์ด ๋ฒ๊ทธ์ธ์ง ํ์ธํ์ฌ ์ด์ ๊ทธ๊ฒ์ด ์ฌ๋ ๊ณณ์ ์ฐพ์ต๋๋ค.
์ ์ ์๋ :)
Ok ์ด๊ฒ์ "์๋ ํ๋๋ก ์๋ํ์ง๋ง ์ฌ์ ํ ๋ฒ๊ทธ"์ค ํ๋์
๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก firebase-tools
์ฝ๋ (์๋ค์ํผ)๋ PUT
๋ฅผ ๊ฐ ํจ์์ ๋ํ ์ ์ฒด functionTriggers
๋ฆฌ์์ค๋ก ๋ณด๋ด๊ณ ์ด๋ฅผ ๋์ฒดํฉ๋๋ค.
์ค์ ๋ก ํ์ํ ๊ฒ์ ํธ๋ฆฌ๊ฑฐ ์ด๋ฆ์ ๊ณ ์ ID๋ก ์ฌ์ฉํ์ฌ ํธ์ถ ํ ์์๋ RTDB ์๋ฎฌ๋ ์ดํฐ์์ ๊ตฌํ ๋ "upsert"์์ ์ ๋๋ค. ์ด๊ฒ์ด Firestore๊ฐ ๊ฐ์ง๊ณ ์๋ ๊ฒ์ ๋๋ค. ์ค๋ ๊ทธ๊ฒ์ ๋ํด ์ด์ผ๊ธฐํ๊ณ ํด๊ฒฐ์ฑ ์ ์ป์ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๋น ๋ฅธ ํผ๋๋ฐฑ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค!
@IanWyszynski ๋ "upsert"์์ ์ ์ถ๊ฐํ๋ ค๊ณ ํฉ๋๋ค.