[Firebase] Bug with importing multiple single quotes value like 5' 11'' #1477
-
|
We have a heights collection having values like this 5' 11'' . When importing to Rowy, it fails |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @jasminder, For example, if you have a value like 5' 11'', you can escape the single quotes like 5' 11'' before importing it into Firebase. Here's an example of how you can handle this in a JavaScript GCP Cloud Function: const admin = require('firebase-admin');
admin.initializeApp();
exports.importData = async (req, res) => {
const data = {
valueWithSingleQuotes: "5\\' 11\\'\\'",
// Other data fields
};
try {
await admin.firestore().collection('yourCollection').add(data);
return res.status(200).send('Data imported successfully');
} catch (error) {
console.error('Error importing data:', error);
return res.status(500).send('Error importing data');
}
};In this example, we are escaping the single quotes in the By properly escaping the single quotes, you should be able to import values like 5' 11'' without any issues in Firebase. |
Beta Was this translation helpful? Give feedback.

Hi @jasminder,
The issue you are facing is related to handling special characters like single quotes in Firebase import. To resolve this issue, you can escape the single quotes using backslashes () before importing the data into Firebase.
For example, if you have a value like 5' 11'', you can escape the single quotes like 5' 11'' before importing it into Firebase.
Here's an example of how you can handle this in a JavaScript GCP Cloud Function: