Skip to main content

Query string that contain ampersand "&" using box sdk node


I am trying to query files based on their metadata template that contain an ampersand ex: “A/7-8&9/389-399” using node box sdk metadata query method but it does not return values. It matches other values that do not have ampersand. Is there a way to handle special characters when trying to query them.

I notice it works only if the query is setup as shown below

       var from = 'enterprise_someid.somekey',
         ancestorFolderId = 'somefolderid',
        options = {
            query : "DocumentId ILIKE :arg1 OR bookAndPageNumber = :arg2",
            query_params: {
                arg1: '%' + params + '%',
                arg2: params
            },
            limit: 10
        };
type or paste code here

If i include the pattern matching operation it does not work

        var from = 'enterprise_someid.somekey',
         ancestorFolderId = 'somefolderid',
        options = {
            query : "DocumentId ILIKE :arg1 OR bookAndPageNumber ILIKE :arg2",
            query_params: {
                arg1: '%' + params + '%',
                arg2: '%' + params + '%'
            },
            limit: 10,
            //fields: 
        };

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings