Search
/api/v2/profile/search
Post
profiles
posts
groups
rooms
jwt
Purpose
To allow a user to save some of his/her previous searches on the platform.
Body Content [input]
{
    uid: string,
    search: string
}
Returns if valid [output]
{
    message: string,
    profiles: {
        profileID: string,
        name: string,
        username: string,
        profile_pic: string,
        cover_image: string,
        bio: string,
        account_type: string,
        followers: string[],
        following: string[],
        followers_length: int,
        following_length: int,
        highlights: {
            highlightID: string,
            name: string,
            icon: string,
            storiesID: string[],
            visibility: string,
            created_on: Date
        }[]
    }[],
    posts: {
        uid: string,
        postID: string,
        content: string,
        posted_on: Date,
        modified_on: Date,
        reacts: string[],
        groupID: string,
        shareID: string,
        comments: {
            uid: string,
            commentID: string,
            reply_to: string,
            posted_on: Date,
            modified_on: Date,
            reacts: string[],
            visibility: string
        }[],
        visibility: string,
        allow_comments: bool,
        senderName: string,
        senderUsername: string,
        groupName: string
    }[],
    groups: {
        groupID: string,
        name: string,
        description: string,
        privacy: string,
        icon: string,
        cover_image: string,
        members: {
            uid: string,
            is_admin: bool,
            status: string
        }[]
    }[],
    rooms: {
        roomID: string,
        name: string,
        description: string,
        privacy: string,
        icon: string,
        members: {
            uid: string,
            is_admin: bool,
            status: string
        }[],
        messages: [],
        threads: []
    }[]
}
What the API does
- Appends the passed 
searchvalue to thesearchesfield in the record from theprofilescollection that has anuidcorresponding to the value of the one passed. - Fetches a list of 
profilesthat the user is allowed to view that contains the value of thesearchfield in theirname,usernameorbiofield and appends the top 20 results of this list to an array to be returned. - Fetches a list of 
poststhat the user is allowed to view that contains the value of thesearchfield in theircontentfield and appends the top 15 results of this list to an array to be returned. - Fetches a list of 
groupsthat the user is allowed to view that contains the value of thesearchfield in theirnameordescriptionfield and appends the top 20 results of this list to an array to be returned. - Fetches a list of 
roomsthat the user is allowed to view that contains the value of thesearchfield in theirnameordescriptionfield and appends the top 20 results of this list to an array to be returned.